Commit 8af58167 authored by Leigh Stoller's avatar Leigh Stoller

Add some silly options for testbed developers:

* -a: This already existed; it modifies the path given to the server
  so that people without a paperbag shell can run the rpc server.

* -z: Modify the path above so that it runs the server from the
  current user's devel tree instead of the main tree.

* -x <user>: Instead of the current user's devel tree, use another
  devel tree.

So, to run my own server:

	/usr/testbed/devel/stoller/bin/sshxmlrpc_client.py -a -z

To run Rob's devel server:

	/usr/testbed/devel/stoller/bin/sshxmlrpc_client.py -a -z -x ricci

Sorry for all this sillyness.
parent b09e0ca9
......@@ -32,9 +32,18 @@ module = "experiment"
# Debugging output.
debug = 0
# For admin people.
SERVER_PATH = "/usr/testbed/sbin/"
#
# For admin people, and for using their devel trees. These options are
# meaningless unless you are an Emulab developer; they will be rejected
# at the server most ungraciously.
#
SERVER_PATH = "/usr/testbed"
SERVER_DIR = "sbin"
DEVEL_DIR = "devel"
develuser = None
path = None
admin = 0
devel = 0
##
# Print the usage statement to stdout.
......@@ -125,7 +134,7 @@ def do_method(server, method_and_args):
try:
# Parse the options,
opts, req_args = getopt.getopt(sys.argv[1:],
"dhVs:l:am:",
"dhVs:l:am:zx:",
[ "help", "version", "server=", "login=", "module="])
# ... act on them appropriately, and
for opt, val in opts:
......@@ -150,7 +159,13 @@ try:
debug = 1
pass
elif opt in ("-a", "--admin"):
path = SERVER_PATH
admin = 1
pass
elif opt in ("-z", "--devel"):
devel = 1
pass
elif opt in ("-x", "--develuser"):
develuser = val
pass
pass
pass
......@@ -160,6 +175,20 @@ except getopt.error, e:
sys.exit(2)
pass
if admin:
path = SERVER_PATH
if devel:
path += "/" + DEVEL_DIR
if develuser:
path += "/" + develuser
pass
else:
path += "/" + login_id
pass
pass
path += "/" + SERVER_DIR
pass
# Get a handle on the server,
server = SSHServerProxy("ssh://" + login_id + "@" + xmlrpc_server +
"/xmlrpc/" + module, path=path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment