Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Correctly append list of command results #106

Merged
merged 1 commit into from
Nov 21, 2017

Conversation

tcaiazza
Copy link
Contributor

In the _execute_methods function, if the results are returned as a list
they were being appended to the results list. So there would be a list
inside the results list, which would later cause an error while trying
to decode the results. This happens when parsing state against an
Arista device. See
#103

If there is a better way to do this let me know and I'll adjust the PR.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 84.854% when pulling cb45164 on tcaiazza:eosStateBug into e391cd0 on napalm-automation:develop.


result.append(r)
if isinstance(r, list):
result += r
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you do instead result.extend(r)? I think it's easier to read,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

In the _execute_methods function, if the results are returned as a list
they were being appended to the results list.  So there would be a list
inside the results list, which would later cause an error while trying
to decode the results.  This happens when parsing state against an
Arista device.  See
napalm-automation#103
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 84.854% when pulling 47472bd on tcaiazza:eosStateBug into 0e141ba on napalm-automation:develop.

@dbarrosop dbarrosop merged commit 0a0e345 into napalm-automation:develop Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants