Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for testcase failing in 3.5.6 #358

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/jnpr/jsnapy/jsnapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,19 +487,21 @@ def login(self, output_file):
gp = first_entry.get('group', 'all')

dgroup = [i.strip().lower() for i in gp.split(',')]
iter = 0
for dgp in dev_file:
if dgroup[0].lower() == 'all' or dgp.lower() in dgroup:
for counter, val in enumerate(dev_file[dgp]):
for val in dev_file[dgp]:
# There can be multiple values of device/hostname
# The values can have same hostname but different port
# key for the dictionary modified from hostname to enumerate value to keep distinction
iter += 1
hostname = list(val)[0]
self.log_detail = {'hostname': hostname}
if val.get(hostname) is not None and hostname not in self.host_list:
#host_dict[hostname] = deepcopy(val.get(hostname))
self.host_list.append(hostname)
host_dict[counter] = deepcopy(val.get(hostname))
host_dict[counter]["device"] = hostname
host_dict[iter] = deepcopy(val.get(hostname))
host_dict[iter]["device"] = hostname

# login credentials are given in main config file, can connect to multiple devices
else:
Expand Down