Help Troubleshooting

Victor Subervi victorsubervi at gmail.com
Fri Mar 12 11:22:19 EST 2010


Hi;
I'm running Pexpect (no discussion list) with the following code:

#! /usr/bin/python
import pexpect

def runVpopmail(whatdo, acct, domain, newpw, oldpw=''):
  if whatdo == 'vadduser':
    child = pexpect.spawn('/home/vpopmail/bin/%s %s@%s %s' % (whatdo, acct,
domain, newpw))
  elif whatdo == 'vchangepw':
    child = pexpect.spawn('/home/vpopmail/bin/%s' % (whatdo))
    child.expect('Please enter the email address: ')
    child.sendline('%s@%s' % (acct, domain))
    child.expect('Enter old password: ')
    child.sendline(oldpw)
    child.expect('Please enter password for %s@%s: ' % (acct, domain))
    child.sendline(newpw)
    child.expect('enter password again: ')
    child.sendline(newpw)
  return child

No matter whether I try to add a user or edit a password, the fn seems to
return that everything is good, but nothing ever happens. When I place a
return of the child value and run it with whatdo==vadduser I get the
following output:

version: 2.3 ($Revision: 399 $) command: /home/vpopmail/bin/vadduser args:
['/home/vpopmail/bin/vadduser', 'test2 at globalsolutionsgroup.vi', 'qqq']
searcher: None buffer (last 100 chars): before (last 100 chars): None after:
None match: None match_index: None exitstatus: None flag_eof: False pid:
1518 child_fd: 3 closed: False timeout: 30 delimiter: pexpect.EOF logfile:
None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False
searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1
delayafterterminate: 0.

I don't know what this means. Any ideas on how to troubleshoot this?
TIA,
beno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100312/85daae84/attachment.html>


More information about the Python-list mailing list