def __init__(self, username, password): process = UserProcess(username, password) self.nodes = self.GetNodes(process) self.queue = self.GetQueue(process) self.disk = self.GetDiskUsage(process, settings.JMS_SETTINGS["JMS_shared_directory"]) process.close()
#!/usr/bin/env python import sys sys.path.append("..") from utilities.io.shell import UserProcess username = sys.argv[1] password = sys.argv[2] venv = None if len(sys.argv) > 3: venv = sys.argv[3] try: process = UserProcess(username, password) if venv: out = process.run_command("source %s" % venv) process.close() except Exception, err: print(err) print 0