[Libguestfs] About libguestfs python3.6 command execution
Tomáš Golembiovský
tgolembi at redhat.com
Mon Nov 30 16:21:34 UTC 2020
> > http://paste.openstack.org/show/800517/
This won't solve your issue with being unable to execute /bin/sh, but
the above does not work like that. You need to first add at least one
disk and then run the libguestfs appliance:
>>> import guestfs
>>> g = guestfs.GuestFS(python_return_dict=True)
>>> g.add_drive("my-machine.qcow2")
>>> g.launch()
>>> g.list_filesystems()
{'/dev/sda1': 'xfs'}
>>> g.mount('/dev/sda1', '/')
>>> g.sh("test 1 == 1")
''
>>> g.sh("echo yes")
'yes\n'
--
Tomáš Golembiovský <tgolembi at redhat.com>
More information about the Libguestfs
mailing list