Skip to content

config modules don't raise error if the credentials are incorrect #198

@noredistribution

Description

@noredistribution

For example when trying to create vlans if the credentials are incorrect we only print False

e.g. if you do something like this

import pyeapi

connect = pyeapi.connect_to("leaf1-DC1")
print(connect)

vlan_ids = ["10","20","30","40","50"]

for vlan in vlan_ids:
    connect.api('vlans').create(vlan)
    print(f"Creating vlan {vlan}")

that doesn't raise any error; if you print the connect statement then it prints False, wherease if you use get or getallfunctions that raises the correct error

  File "/usr/local/lib/python3.7/dist-packages/pyeapi/eapilib.py", line 455, in send
    response_content))
pyeapi.eapilib.ConnectionError: Unauthorized. b'Unable to authenticate user: Bad username/password combination'

seems like we don't raise error here:

except (CommandError, ConnectionError):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions