Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Unsupported operand type(s), line 164 in expect #74

@apaxson

Description

@apaxson

Currently executing a multiple expect option. The code is:

ssh_client = SSHClientInteraction(remote_conn_pre, timeout=10, display=True)
# ... STUFF
i = ssh_client.expect(".* ERROR .*$", "Restarting the system\.{3}\s*")

This is where I'm determining if my sent command ends in an error, or the correct "restart". When the code executes, I get the following traceback:

Traceback (most recent call last):
  File "/Users/apax/Devel/ssh_cmd_EDA/ssh_interact.py", line 45, in <module>
    i = ssh_client.expect(".* ERROR .*$", "Restarting the system\.{3}\s*")
  File "/Users/apax/Library/Python/3.8/lib/python/site-packages/paramiko_expect.py", line 164, in expect
    if time.time() >= (base_time + timeout):
TypeError: unsupported operand type(s) for +: 'float' and 'str'

I can't imagine a time where "timeout" would ever be a string? If I remove the multiple expect options, it runs through fine.
This is using version 0.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions