Skip to content

Instantly share code, notes, and snippets.

@caphrim007
Created August 15, 2017 18:02
Show Gist options
  • Save caphrim007/0ba1531401f51d1d9f5b6213dedd7848 to your computer and use it in GitHub Desktop.
Save caphrim007/0ba1531401f51d1d9f5b6213dedd7848 to your computer and use it in GitHub Desktop.
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