Skip to content

Commit 679db0d

Browse files
committed
Fix count entries added to /etc/hosts
1 parent 7addd22 commit 679db0d

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

nets/8r-1c-in-band-isis/isis8d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ def add_nodes_to_etc_hosts():
237237
# Import host-ip mapping defined in etc-hosts file
238238
count = etc_hosts.import_file(ETC_HOSTS_FILE)
239239
# Print results
240-
print('*** Added %s entries to /etc/hosts\n' % count['write_result']['total_written'])
240+
count = count['add_result']['ipv6_count'] + count['add_result']['ipv4_count']
241+
print('*** Added %s entries to /etc/hosts\n' % count)
241242

242243

243244
def remove_nodes_from_etc_hosts(net):

nets/8r-1c-out-band-isis/isis8d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ def add_nodes_to_etc_hosts():
287287
# Import host-ip mapping defined in etc-hosts file
288288
count = etc_hosts.import_file(ETC_HOSTS_FILE)
289289
# Print results
290-
print('*** Added %s entries to /etc/hosts\n' % count['write_result']['total_written'])
290+
count = count['add_result']['ipv6_count'] + count['add_result']['ipv4_count']
291+
print('*** Added %s entries to /etc/hosts\n' % count)
291292

292293

293294
def remove_nodes_from_etc_hosts(net):

nets/8r-1c-srv6-pm/isis8d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ def add_nodes_to_etc_hosts():
287287
# Import host-ip mapping defined in etc-hosts file
288288
count = etc_hosts.import_file(ETC_HOSTS_FILE)
289289
# Print results
290-
print('*** Added %s entries to /etc/hosts\n' % count['write_result']['total_written'])
290+
count = count['add_result']['ipv6_count'] + count['add_result']['ipv4_count']
291+
print('*** Added %s entries to /etc/hosts\n' % count)
291292

292293

293294
def remove_nodes_from_etc_hosts(net):

nets/8routers-isis-ipv6/isis8d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def add_nodes_to_etc_hosts():
208208
# Import host-ip mapping defined in etc-hosts file
209209
count = etc_hosts.import_file(ETC_HOSTS_FILE)
210210
# Print results
211-
print('*** Added %s entries to /etc/hosts\n' % count['write_result']['total_written'])
211+
count = count['add_result']['ipv6_count'] + count['add_result']['ipv4_count']
212+
print('*** Added %s entries to /etc/hosts\n' % count)
212213

213214

214215
def remove_nodes_from_etc_hosts(net):

nets/8routers/ospf8r.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ def add_nodes_to_etc_hosts():
198198
# Import host-ip mapping defined in etc-hosts file
199199
count = etc_hosts.import_file(ETC_HOSTS_FILE)
200200
# Print results
201-
print('*** Added %s entries to /etc/hosts\n' % count['write_result']['total_written'])
201+
count = count['add_result']['ipv6_count'] + count['add_result']['ipv4_count']
202+
print('*** Added %s entries to /etc/hosts\n' % count)
202203

203204

204205
def remove_nodes_from_etc_hosts(net):

0 commit comments

Comments
 (0)