summaryrefslogtreecommitdiffstats
path: root/libs/utils/managerutils.py
diff options
context:
space:
mode:
authorShwetha-H-Panduranga <shwetha@gluster.com>2011-12-12 11:29:47 +0530
committerShwetha-H-Panduranga <shwetha@gluster.com>2011-12-12 11:29:47 +0530
commit689f862f24f949361603a808250ae3f7ec9f40f6 (patch)
tree37894a4807f9fcf1edab4ad846e57d8ba339cf13 /libs/utils/managerutils.py
parentd7524954807ed63ed05762a945e7e6956c929eda (diff)
Changes to logger class, Using the logger class in the framework, adding new global values, Changes made to argument parser, testruninfo
Diffstat (limited to 'libs/utils/managerutils.py')
-rw-r--r--libs/utils/managerutils.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/utils/managerutils.py b/libs/utils/managerutils.py
index ca38b3f..6f72e99 100644
--- a/libs/utils/managerutils.py
+++ b/libs/utils/managerutils.py
@@ -13,13 +13,19 @@ from atfglobals import GlobalObj
def ssh_connect(hostkey):
"""
"""
+ logger = GlobalObj.getLoggerObj()
env = GlobalObj.getTestenvObj()
cm = GlobalObj.getConnectionsManagerObj()
+ if cm is None:
+ logger.error("Init ConnectionsManager")
+ return 1
+
host_connection = cm.getConnection(hostkey)
if not host_connection:
host_obj = env.getHost(hostkey)
if not host_obj:
- print "Invalid Host. %s is not defined in TestEnvironment" % hostkey
+ logger.error("Invalid Host. %s is not defined in TestEnvironment"
+ % hostkey)
return 1
else:
host_connection = ssh.SshConnection()
@@ -33,13 +39,14 @@ def ssh_connect(hostkey):
cm.addClient(hostkey, host_connection)
return 0
else:
- print "Connection to %s already exist" % hostkey
+ logger.debug("Connection to %s already exist" % hostkey)
return 0
def ssh_connect_allhosts():
"""
"""
+ GlobalObj.initConnectionsManagerObj()
env = GlobalObj.getTestenvObj()
cm = GlobalObj.getConnectionsManagerObj()
hosts_keys = env.getHostsKeys()