6 #NOTE: I'm so sorry for this.
8 # if this file deos not exist, then we will jump to the exception and use
9 # the local PLCSH without passing any additional arguments.
10 os.stat("/etc/planetlab/master.py")
11 sys.path.append("/etc/planetlab")
14 # Use the values given to us in the /etc/planetlab/master.py file taken from
15 # the master PLC and use them to construct the proper arguments to plcsh so
16 # that we can get a user list from managing, CoPLC
17 user=master.PLC_ROOT_USER
18 passwd=master.PLC_ROOT_PASSWORD
19 url = "https://" + master.PLC_API_HOST + ":" \
20 + master.PLC_API_PORT + master.PLC_API_PATH
22 plcsh_args = "--user=%s --password=%s --url=%s %s" % (user, passwd, url, " ".join(sys.argv[1:]))
24 plcsh_args = "%s" % " ".join(sys.argv[1:])
26 dir = "/usr/share/plcrt"
27 os.system("chmod 755 %s/getpersons.py" % dir)
28 os.system("%s/getpersons.py %s -- admin | %s/adduserstort.pl priv -" % ( dir, plcsh_args, dir) )