Commit e241fb50 authored by hardy's avatar hardy

fix ssh remote access to UE module

parent 03edcdec
...@@ -62,7 +62,7 @@ class Module_UE: ...@@ -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: ...@@ -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: ...@@ -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):
......
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