fix netdev regex
This commit is contained in:
3 files changed
+24
-25
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import pexpect
|
||||
|
||||
global_qm_timeout = 10
|
||||
|
||||
def qm_term_cmd(vm_id, cmd, timeout=global_qm_timeout):
|
||||
child = pexpect.spawn(f'qm monitor {vm_id}')
|
||||
try:
|
||||
child.expect('qm>', timeout=timeout)
|
||||
child.sendline(cmd)
|
||||
child.expect('qm>', timeout=timeout)
|
||||
raw_output = child.before.decode('utf-8').strip()
|
||||
finally:
|
||||
child.close()
|
||||
|
||||
return raw_output
|
||||
Reference in new issue
Block a user