>>> ssh.execute('id', verbose=True) uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),111(lxd),115(lpadmin),116(sambashare),117(libvirtd) 2016-09-12 10:15:20 - INFO - ssh_client.py:853 -- 'id' execution results: Exit code: EX_OK<0(0x00)> STDOUT: uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),111(lxd),115(lpadmin),116(sambashare),117(libvirtd) STDERR:
ExecResult(cmd='id', stdout=['uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),111(lxd),115(lpadmin),116(sambashare),117(libvirtd)\n'], stderr=[], exit_code=EX_OK<0(0x00)>) >>> with ssh.sudo(True):ssh.execute('id', verbose=True) uid=0(root) gid=0(root) groups=0(root) [sudo] password for ubuntu: 2016-09-12 10:15:43 - INFO - ssh_client.py:853 -- 'id' execution results: Exit code: EX_OK<0(0x00)> STDOUT: uid=0(root) gid=0(root) groups=0(root) STDERR: [sudo] password for ubuntu: ExecResult(cmd='id', stdout=['uid=0(root) gid=0(root) groups=0(root)\n'], stderr=['[sudo] password for ubuntu: '], exit_code=EX_OK<0(0x00)>)
Need to check detaily on CI with dedicated test
>>> ssh.execute('id', verbose=True) 1000(ubuntu) ,4(adm) ,24(cdrom) ,27(sudo) ,30(dip) ,46(plugdev) ,111(lxd) ,115(lpadmin) ,116(sambashare ),117(libvirtd) 1000(ubuntu) ,4(adm) ,24(cdrom) ,27(sudo) ,30(dip) ,46(plugdev) ,111(lxd) ,115(lpadmin) ,116(sambashare ),117(libvirtd)
uid=1000(ubuntu) gid=1000(ubuntu) groups=
2016-09-12 10:15:20 - INFO - ssh_client.py:853 -- 'id' execution results:
Exit code: EX_OK<0(0x00)>
STDOUT:
uid=1000(ubuntu) gid=1000(ubuntu) groups=
STDERR:
ExecResult( cmd='id' , stdout= ['uid=1000( ubuntu) gid=1000(ubuntu) groups= 1000(ubuntu) ,4(adm) ,24(cdrom) ,27(sudo) ,30(dip) ,46(plugdev) ,111(lxd) ,115(lpadmin) ,116(sambashare ),117(libvirtd) \n'], stderr=[], exit_code= EX_OK<0( 0x00)>) True):ssh. execute( 'id', verbose=True) cmd='id' , stdout= ['uid=0( root) gid=0(root) groups=0(root)\n'], stderr=['[sudo] password for ubuntu: '], exit_code= EX_OK<0( 0x00)>)
>>> with ssh.sudo(
uid=0(root) gid=0(root) groups=0(root)
[sudo] password for ubuntu: 2016-09-12 10:15:43 - INFO - ssh_client.py:853 -- 'id' execution results:
Exit code: EX_OK<0(0x00)>
STDOUT:
uid=0(root) gid=0(root) groups=0(root)
STDERR:
[sudo] password for ubuntu:
ExecResult(
Need to check detaily on CI with dedicated test