Created
September 10, 2011 02:25
-
-
Save jerrykuch/1207851 to your computer and use it in GitHub Desktop.
OH THE HORROR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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