fix ssh remote access to UE module
This commit is contained in:
@@ -62,7 +62,7 @@ class Module_UE:
|
|||||||
#this method checks if the specified Process is running on the server hosting the module
|
#this method checks if the specified Process is running on the server hosting the module
|
||||||
#if not it will be started
|
#if not it will be started
|
||||||
def CheckCMProcess(self):
|
def CheckCMProcess(self):
|
||||||
HOST=self.HostIPAddress
|
HOST=self.HostUsername+'@'+self.HostIPAddress
|
||||||
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep "
|
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep "
|
||||||
logging.debug(COMMAND)
|
logging.debug(COMMAND)
|
||||||
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||||
@@ -80,7 +80,7 @@ class Module_UE:
|
|||||||
mySSH.close()
|
mySSH.close()
|
||||||
#checking the process
|
#checking the process
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
HOST=self.HostIPAddress
|
HOST=self.HostUsername+'@'+self.HostIPAddress
|
||||||
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep "
|
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep "
|
||||||
logging.debug(COMMAND)
|
logging.debug(COMMAND)
|
||||||
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||||
@@ -104,7 +104,7 @@ class Module_UE:
|
|||||||
|
|
||||||
#this method retrieves the Module IP address (not the Host IP address)
|
#this method retrieves the Module IP address (not the Host IP address)
|
||||||
def GetModuleIPAddress(self):
|
def GetModuleIPAddress(self):
|
||||||
HOST=self.HostIPAddress
|
HOST=self.HostUsername+'@'+self.HostIPAddress
|
||||||
response= []
|
response= []
|
||||||
tentative = 3
|
tentative = 3
|
||||||
while (len(response)==0) and (tentative>0):
|
while (len(response)==0) and (tentative>0):
|
||||||
|
|||||||
Reference in New Issue
Block a user