Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 42 lines (35 sloc) 1.098 kb
#!/usr/bin/env python
import pexpect
import sys
import os
to=int(os.environ["NIMBUS_TEST_TIMEOUT"])
tst_image_name = os.environ['NIMBUS_TEST_IMAGE']
tst_image_src = os.environ['NIMBUS_SOURCE_TEST_IMAGE']
cc_home=os.environ['CLOUD_CLIENT_HOME']
logfile = sys.stdout
newname="XXXX"
try:
os.remove(newname)
except:
pass
cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, tst_image_src)
(x, rc)=pexpect.run(cmd, withexitstatus=1, timeout=to)
cmd = "%s/bin/cloud-client.sh --run --name %s --hours .25" % (cc_home, tst_image_name)
child = pexpect.spawn (cmd, timeout=to, maxread=20000, logfile=logfile)
rc = child.expect ('Running:')
if rc != 0:
print "%s not found in the list" % (tst_image_name)
sys.exit(1)
handle = child.readline().strip().replace("'", "")
rc = child.expect(pexpect.EOF)
if rc != 0:
print "run"
sys.exit(1)
cmd = "%s/bin/cloud-client.sh --handle %s --save" % (cc_home, handle)
print cmd
(x, rc)=pexpect.run(cmd, withexitstatus=1, timeout=to, logfile=logfile)
print x
if rc != 0:
print "failed to save"
sys.exit(1)
sys.exit(0)
Jump to Line
Something went wrong with that request. Please try again.