Created
August 15, 2017 18:02
-
-
Save caphrim007/0ba1531401f51d1d9f5b6213dedd7848 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def execute_on_device(self, commands): | |
responses = [] | |
for item in to_list(commands): | |
import q | |
q.q(item['command']) | |
output = self.client.api.tm.util.bash.exec_cmd( | |
'run', | |
utilCmdArgs='-c "{0}"'.format(item['command']) | |
) | |
if hasattr(output, 'commandResult'): | |
responses.append(str(output.commandResult)) | |
return responses |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment