Skip to content

Confirm napalm context manager bugfix #30

@Mierdin

Description

@Mierdin

We're currently using the with statement in the NAPALM actions to automatically open a connection to the device before doing anything with it. However, this appears to not have the desired effect, because when there's a connection problem, it still runs the next line (which errors because it is not set correctly):

vagrant@st2vagrant:~$ st2 run napalm.get_config hostname=vsrx01
.
id: 599740dfc4da5f04e42e6cda
status: failed
parameters:
  hostname: vsrx01
result:
  exit_code: 0
  result: '''bool'' object has no attribute ''get_config'''
  stderr: 'st2.actions.python.NapalmGetConfig: ERROR    ''bool'' object has no attribute ''get_config''

    '
  stdout: 'NAPALM didn''t catch this exception. Please, fill a bugfix on https://github.com/napalm-automation/napalm/issues

    Don''t forget to include this traceback.

Turns out this is a bug in napalm_base which has been fixed and will be included in the next release of NAPALM.

So we should circle back and confirm this behavior is fixed once the next release comes out.

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