Portability implementation
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 271c0dd..2661715 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -163,12 +163,20 @@
driverClass = getattr(driverModule, driverName)
driverObject = driverClass()
- try:
- self.componentDictionary[component]['host'] = os.environ[str( self.componentDictionary[component]['host'])]
- except KeyError:
- self.log.info("Missing OC environment variable! Using stored IPs")
- except Exception as inst:
- self.log.error("Uncaught exception: " + str(inst))
+ if "OC" in self.componentDictionary[component]['host']:
+ try:
+ self.componentDictionary[component]['host'] = os.environ[str( self.componentDictionary[component]['host'])]
+ except KeyError:
+ self.log.info("Missing OC environment variable! Using stored IPs")
+ f = open("myIps","r")
+ ips = f.readlines()
+ for line in ips:
+ if self.componentDictionary[component]['host'] in line:
+ line = line.split("=")
+ myIp = line[1]
+ self.componentDictionary[component]['host'] = myIp
+ except Exception as inst:
+ self.log.error("Uncaught exception: " + str(inst))
connect_result = driverObject.connect(user_name = self.componentDictionary[component]['user'] if ('user' in self.componentDictionary[component].keys()) else getpass.getuser(),
ip_address= self.componentDictionary[component]['host'] if ('host' in self.componentDictionary[component].keys()) else 'localhost',