On Fri, Jul 22, 2011 at 04:38:20PM -0400, Cole Robinson wrote:
> $ cat test.py
> import os
> import sys
> import libvirt
>
> def drop_tty():
> if os.fork() != 0:
> os._exit(0)
> os.setsid()
>
> host = sys.argv[1]
>
> # Need to drop controlling tty otherwise SSH won't call askpass
$ cat test.py
import os
import sys
import libvirt
def drop_tty():
if os.fork() != 0:
os._exit(0)
os.setsid()
host = sys.argv[1]
# Need to drop controlling tty otherwise SSH won't call askpass
drop_tty()
libvirt.open("qemu+ssh://root@%s/system" % host)
$ python test.py localhost