Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def virsh(args):
result = sarge.capture_stdout('virsh {}'.format(args))
if result.returncode != 0:
raise RuntimeError('virsh command failed with exit code {}'.format(result.returncode))
return result.stdout.read().strip()
def stdout(command):
return sarge.capture_stdout(command).stdout.text.strip()
def run_remote(self, cmd, input=None):
host = self.args['--host']
return capture_stdout('ssh %s -- %s' % (host, cmd), input=input)