diff options
Diffstat (limited to 'libs/utils/serverutils.py')
-rw-r--r-- | libs/utils/serverutils.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/utils/serverutils.py b/libs/utils/serverutils.py index 226f35e..068dd17 100644 --- a/libs/utils/serverutils.py +++ b/libs/utils/serverutils.py @@ -7,6 +7,11 @@ from atfglobals import GlobalObj def execute_on_brick(brickkey, command, commandInput=None): """ """ + output = {} + output["exitstatus"] = None + output["stdoutdata"] = None + output["stderrdata"] = None + logger = GlobalObj.getLoggerObj() env = GlobalObj.getTestenvObj() @@ -14,19 +19,19 @@ def execute_on_brick(brickkey, command, commandInput=None): if not raw_brick_obj: logger.error("InValid Brick. %s not defined in TestEnvironment" % brickkey) - return 1 + return output serverkey = re.split("\.", raw_brick_obj.hostname, maxsplit=1)[0] brick_obj = env.getBrick(brickkey) if not brick_obj: logger.error("InValid Brick. %s not defined in TestEnvironment" % brickkey) - return 1 + return output exportdirpath = brick_obj.path command = "cd " + exportdirpath + ";" + command output = hostutils.execute_command(serverkey, command, commandInput) - return output['exitstatus'] + return output __all__ = ['execute_on_brick'] |