Commit 96faef13 authored by David Johnson's avatar David Johnson

Add --port arg to script_wrapper.py.

parent 499aacc2
#! /usr/bin/env python
#
# Copyright (c) 2004-2016 University of Utah and the Flux Group.
# Copyright (c) 2004-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -47,8 +47,9 @@ PACKAGE_VERSION = 0.1
XMLRPC_SERVER = "@BOSSNODE@"
XMLRPC_PORT = 3069
# User supplied server name.
# User supplied server name/port
xmlrpc_server = XMLRPC_SERVER
xmlrpc_port = XMLRPC_PORT
# User supplied login ID to use (overrides env variable USER if exists).
login_id = os.environ["USER"]
......@@ -195,6 +196,7 @@ def wrapperoptions():
print "Wrapper Options:"
print " --help Display this help message"
print " --server Set the server hostname"
print " --port Set the server port"
print " --login Set the login id (defaults to $USER)"
print " --cert Specify the path to your testbed SSL certificate"
print " --debug Turn on semi-useful debugging"
......@@ -219,7 +221,7 @@ def do_method(module, method, params):
from M2Crypto.m2xmlrpclib import SSL_Transport
from M2Crypto import SSL
URI = "https://" + xmlrpc_server + ":" + str(XMLRPC_PORT) + SERVER_PATH
URI = "https://" + xmlrpc_server + ":" + str(xmlrpc_port) + SERVER_PATH
ctx = SSL.Context("sslv23")
ctx.load_cert(certificate, certificate)
......@@ -3049,7 +3051,7 @@ for arg in sys.argv[1:]:
try:
# Parse the options,
opts, req_args = getopt.getopt(wrapper_argv[0:], "",
[ "help", "server=", "login=", "cert=", "admin", "devel",
[ "help", "server=", "port=", "login=", "cert=", "admin", "devel",
"develuser=", "impotent", "debug"])
# ... act on them appropriately, and
for opt, val in opts:
......@@ -3060,6 +3062,9 @@ try:
elif opt == "--server":
xmlrpc_server = val
pass
elif opt == "--port":
xmlrpc_port = int(val)
pass
elif opt == "--login":
login_id = val
pass
......
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