Comments (7)
Same issue here!
from paramiko-expect.
can you guy share an example ?
from paramiko-expect.
timeout = 30
display = False
cmd = passwd
password = mynewpassword
exp_dict = {
"New password: ":"{}".format(password),
"Retype new password: ":"{}".format(password),
"passwd: all authentication tokens updated successfully.":"\n"
}
prompts = []
try:
for prompt in exp_dict:
prompts.append(prompt)
except Exception:
print('Error building prompts list from exp_dict!')
return '!! Failed !!'
try:
# Create a new SSH client object
client = paramiko.SSHClient()
# Set SSH key parameters to auto accept unknown hosts
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
# Connect to the host
client.connect(hostname=server, username=myusername, password=mypassword)
# Create a client interaction class which will interact with the host
with SSHClientInteraction(client, timeout=timeout, display=display) as interact:
interact.send(cmd)
for prompt in prompts:
interact.expect(prompts) #expect a prompt for our prompts list
interact.send(exp_dict[interact.last_match]) #send the value assinged to prompt key
interact.send('exit')
interact.expect()
status = 'Success'
except Exception:
status = '!! Failed !!'
pass
finally:
try:
client.close()
except:
pass
return status
I am experiencing this same problem. Sometimes it returns success, sometimes it returns failure. If I add a 'time.sleep(.2)' after .send(), it seems to return success more often but still not 100%.
from paramiko-expect.
Same issue here!,the not set time.sleep(2),after send,the expect get erro output, especically same time the output out of order after loop send command and expect
from paramiko-expect.
I am also having the same issue ..
from paramiko-expect.
Facing similar issue. In my case, first partial output coming in self.current_output_clean
and then this issue occurs for successive commands.
from paramiko-expect.
Any workarounds or fix yet?
from paramiko-expect.
Related Issues (20)
- 0.3.0 version not available on pypi mirror HOT 6
- 0.3.0 expect match issue when channel receives multiple lines of strings at the same time. HOT 1
- EXCESS TIME RECV_READY TIMEOUT, did you expect() before a send() on offical sample. HOT 6
- socket.timeout() raises AttributeError Exception HOT 1
- Paramiko Timeout issue HOT 1
- Unsupported operand type(s), line 164 in expect HOT 4
- IndexError with ANSI codes
- sdist is missing on pypi for 0.3.2 HOT 1
- SSHClientInteraction's current_output_clean is not clean HOT 1
- How to put the output we get from expect prompt in a file HOT 2
- take_control always times out HOT 3
- Check whether channel is closed before checking recv_ready() HOT 1
- add term support to SSHClientInteraction , to pass onto invoke_shell HOT 7
- Error : Undefined symbol "SSLv3_client_method" HOT 2
- Issues with paramiko-expect while interacting with prompt of a remote ssh server
- Issue while sending very big command HOT 2
- expect always fails with "EXCESS TIME RECV_READY TIMEOUT, did you expect() before a send()" error HOT 9
- Moving this repo into its own organisation HOT 3
- Maintainers required HOT 7
- Paramiko expect on windows 2019 vms is giving a lot of residue output HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paramiko-expect.