Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 463 Bytes
#!/usr/bin/env python
import pexpect
import sys
from ConfigParser import SafeConfigParser
cmd = "%s %s" % (sys.argv[1], sys.argv[2])
print cmd
logfile = sys.stdout
child = pexpect.spawn (cmd, timeout=800, maxread=200000, logfile=logfile)
child.expect ('CA Name:')
print child.before
child.sendline ('CA')
child.expect ('Hostname:')
print child.before
child.sendline ('localhost')
rc = child.expect(pexpect.EOF)
print child.before
x = child.readlines()
print x
Something went wrong with that request. Please try again.