def getMelioClient(self, host): # Get an instance of the websockets library to the Melio UI logName="melio-%s" % threading.currentThread().getName() if not logName in self.logNames: xenrt.setupLogging(logName, forceThisTEC=True) self.logNames.append(logName) return self._MelioClient("%s:8080" % host.getIP(), request_timeout=300, log_name=logName)
def __init__(self, hosts, iscsiHost=None): self.hosts = hosts for host in self.hosts: host.melioHelper = self self.lun = None self._scsiid = None self.guid = None self._iscsiHost = iscsiHost self.logNames = [] # Get a checkout of the Melio Python library if not xenrt.TEC().lookup("MELIO_PYTHON_LOCAL_PATH", None): d = xenrt.TempDirectory() xenrt.util.command("cd %s && git clone %s melio-python" % (d.path(), xenrt.TEC().lookup("MELIO_PYTHON_REPO", "https://gitlab.citrite.net/xs-melio/python-melio-linux.git"))) xenrt.util.command("cd %s/melio-python && git checkout %s" % (d.path(), xenrt.TEC().lookup("MELIO_PYTHON_BRANCH", "master"))) xenrt.GEC().config.setVariable("MELIO_PYTHON_LOCAL_PATH", "%s/melio-python" % d.path()) sys.path.append("%s/melio-python/lib" % d.path()) xenrt.setupLogging("sanbolic") import sanbolic self._MelioClient = sanbolic.Client