Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77139

Problem with pexpect when executing a command on a remote machine

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <kiran.venkumahanti@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'output': 0.05; 'failing': 0.07; 'skip:\\ 20': 0.07; 'executed': 0.09; 'skip:/ 10': 0.09; 'skip:\\ 10': 0.09; 'subject:command': 0.09; 'python': 0.11; '(last': 0.16; 'command:': 0.16; 'kiran': 0.16; 'skip:[ 40': 0.16; 'skip:\\ 30': 0.16; 'subject:Problem': 0.16; 'subject:when': 0.16; 'timeout': 0.16; 'sender:addr:gmail.com': 0.17; 'trying': 0.19; 'advance.': 0.19; 'properly': 0.19; 'command': 0.22; 'machine': 0.22; 'error': 0.23; 'config': 0.24; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; 'getting': 0.31; 'file': 0.32; 'this.': 0.32; 'skip:# 10': 0.33; 'subject:with': 0.35; 'possible.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'machine.': 0.36; 'module.': 0.36; 'returning': 0.36; 'thanks': 0.36; 'hi,': 0.36; 'error.': 0.37; 'remote': 0.38; 'sometimes': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'skip:- 10': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'commands': 0.60; 'skip:\xc2 10': 0.60; 'most': 0.60; 'kindly': 0.61; 'soon': 0.63; 'skip:n 10': 0.64; 'reply': 0.66; 'header :Reply-To:1': 0.67; 'skip:r 40': 0.68; 'skip:r 30': 0.69; 'reply- to:no real name:2**0': 0.71; '100': 0.79; 'reply- to:addr:gmail.com': 0.80; 'exceeded': 0.97
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:date:message-id:subject:from:to :content-type; bh=1WVwSDlo7jG+E8H0uYU6REExp+QSAqpWejv3zUGb3ZM=; b=zlC01JkyHri5WpVyC2vxGKQgTGYA0l3CizT4hwFx7LkIpB8HvRtg+IkDGHGnpdxZHK n1Pzhpy8hom0D0MU26OsbryXeDXPS6vPziC/hR9x8ypSa7iemlV9Q9y9F6RVbBRHGyMo MsUt9fHSQyPrUUTBQ4GrrFTe3ievIRibGY2goGqhFotk08HwhC3G6h7wtgeSmBLzJivI 9XJXMGGtmceW78Demt+LIoGZs+ddt/szyOsta2JZC7U03dFOTQ32HQVIia3SVkKh4Q7c tYRGm4qaown8VIYh08wNAsa1R6/Bq2qYJZVa6DY+fR57qO+apM7j2HaiqGzgjSHtj8iZ aeww==
MIME-Version 1.0
X-Received by 10.152.19.5 with SMTP id a5mr35111382lae.21.1409153259724; Wed, 27 Aug 2014 08:27:39 -0700 (PDT)
Sender kiran.venkumahanti@gmail.com
Date Wed, 27 Aug 2014 20:57:39 +0530
X-Google-Sender-Auth U4JB72TQyUGgj7sgL0HFWmgq9Lc
Subject Problem with pexpect when executing a command on a remote machine
From Kiran kumar Venkumahanti <leo.cool001@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=089e0149422a7ae4e005019e0fd9
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To kiran.venkumahanti@gmail.com
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13512.1409153261.18130.python-list@python.org> (permalink)
Lines 83
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409153261 news.xs4all.nl 2843 [2001:888:2000:d::a6]:46337
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77139

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

I am trying to execute a command on a remote machine for which I am using
Python pexpect module. Iam able to connect and copy files to the remote
machine but getting the following error when trying to execute commands on
the remote machine. Please find the below error.


''Error sending command: cluster config -r -a Timeout exceeded in
read_nonblocking().\n<scp_ssh_lib.eSSH object at 0xa60cd0>\nversion: 2.4
($Revision: 516 $)\ncommand: /usr/bin/ssh\nargs: [\'/usr/bin/ssh\', \'-o\',
\'ServerAliveInterval=60\', \'-o\', \'UserKnownHostsFile=/dev/null\',
\'-o\', \'StrictHostKeyChecking=no\', \'root@192.168.7.1\', \'-p\',
\'22\']\nsearcher: searcher_re:\n    0: re.compile("(:[^\\r\\n]*
#|[^\\r\\n]*] ->| [^\\r\\n]*][$#]|:[^\\r\\n]*[$#])")\nbuffer (last 100
chars):  \x1b[0;10mcluster config -r -a\r\nConfiguration is
OK!\r\nReloading configuration on all nodes\r\n\nbefore (last 100 chars):
 \x1b[0;10mcluster config -r -a\r\nConfiguration is OK!\r\nReloading
configuration on all nodes\r\n\nafter: <class
\'pexpect.pexpect.TIMEOUT\'>\nmatch: None\nmatch_index: None\nexitstatus:
None\nflag_eof: False\npid: 28817\nchild_fd: 7\nclosed: False\ntimeout:
10\ndelimiter: <class \'pexpect.pexpect.EOF\'>\nlogfile:
None\nlogfile_read: None\nlogfile_send: None\nmaxread: 2000\nignorecase:
False\nsearchwindowsize: None\ndelaybeforesend: 0.05\ndelayafterclose:
0.1\ndelayafterterminate: 0.1'

If we notice the error, the command is getting properly executed and the
output is also fetched but it returning a TIMEOUT error in
read_nonblocking() function of pxssh.py file of the pexpect module.

Please let me know how can I avoid this. Even the error is not consistent,
sometimes I am able to execute properly but it is failing most of the times.

Kindly reply me as soon as possible.

Thanks in advance.

Regards,
Kiran

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Problem with pexpect when executing a command on a remote machine Kiran kumar Venkumahanti <leo.cool001@gmail.com> - 2014-08-27 20:57 +0530

csiph-web