X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/blobdiff_plain/d2a8f9face2cbaa0489554eabb416e04f5c86d97..da7db23885fdafeca2346bd27c7ec7f5eb40c3cc:/files/usr/sbin/sipb-xen-lvcopy?ds=sidebyside diff --git a/files/usr/sbin/sipb-xen-lvcopy b/files/usr/sbin/sipb-xen-lvcopy index 065cda2..53c5aa8 100755 --- a/files/usr/sbin/sipb-xen-lvcopy +++ b/files/usr/sbin/sipb-xen-lvcopy @@ -7,6 +7,11 @@ import tempfile import time from subprocess import call, check_call, Popen, PIPE +# Make sure to use up fd 0 to avoid a bug in subprocess in Python <= 2.5.1 +# NB we need to do this on every Python remctl script. +# See r53624 in Python svn. +sys.stdin = open('/dev/null') + def losetup(source, offset=0): p = Popen(['sipb-xen-losetup', source, str(offset)], stdout=PIPE) return p.communicate()[0].strip() @@ -43,6 +48,9 @@ def frob_copy(target, hostname, rootpw): call(['losetup', '-d', fs]) def duplicate_by_vm(source, target, rootpw, nodd=False, nofrob=False): + if source != "ice3": + print "Error: can't clone that VM" + sys.exit(1) # source, target should be machine names prefix = 'd_' # 1. copy (by dd) source to target