Skip to content

Instantly share code, notes, and snippets.

@jerrykuch
Created September 10, 2011 02:25
Show Gist options
  • Save jerrykuch/1207851 to your computer and use it in GitHub Desktop.
Save jerrykuch/1207851 to your computer and use it in GitHub Desktop.
OH THE HORROR
def install_vfabric_eula():
retcode_vfabric_eula_rpm_qi = \
subprocess.call(["rpm", "-qi", vfabric_eula_rpm_base])
if retcode_vfabric_eula_rpm_qi == 1:
# Need to install vfabric-eula
try:
child = pexpect.spawn("rpm -i %s" % vfabric_eula_rpm)
child.logfile = sys.stdout
child.expect(".*--More--.*")
child.send('q')
child.expect(".*\[yes/no\].*")
child.sendline('yes')
child.interact()
# print str(child)
except Exception e:
print "exception was thrown %s " % str(e)
print str(child)
elif retcode_vfabric_eula_rpm_qi > 1:
exit("vfabric-eula rpm install failed, code: %s" % retcode_vfabric_eula_rpm_qi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment