1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

adding fix for packet_net.py (#891)

* adding fix for packet_net.py

* adding changelog fragment

* squashing to fix cascading notifications

Apply suggestions from code review

thanks felixfontein for working with me!

Co-authored-by: Felix Fontein <felix@fontein.de>

adding suggestions from code review (accessing dict in a better way)

modified packet_net fragment to accurate description

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
elreydetoda 2020-11-26 01:08:15 -05:00 committed by GitHub
parent d669e2b60d
commit cc7d0f7670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- packet_net.py inventory script - fixed failure w.r.t. operating system retrieval by changing array subscription back to attribute access (https://github.com/ansible-collections/community.general/pull/891).

View file

@ -346,9 +346,9 @@ class PacketInventory(object):
# Inventory: Group by OS # Inventory: Group by OS
if self.group_by_operating_system: if self.group_by_operating_system:
self.push(self.inventory, device.operating_system['slug'], dest) self.push(self.inventory, device.operating_system.slug, dest)
if self.nested_groups: if self.nested_groups:
self.push_group(self.inventory, 'operating_systems', device.operating_system['slug']) self.push_group(self.inventory, 'operating_systems', device.operating_system.slug)
# Inventory: Group by plan type # Inventory: Group by plan type
if self.group_by_plan_type: if self.group_by_plan_type:
@ -395,7 +395,7 @@ class PacketInventory(object):
elif key == 'packet_facility': elif key == 'packet_facility':
device_vars[key] = value['code'] device_vars[key] = value['code']
elif key == 'packet_operating_system': elif key == 'packet_operating_system':
device_vars[key] = value['slug'] device_vars[key] = value.slug
elif key == 'packet_plan': elif key == 'packet_plan':
device_vars[key] = value['slug'] device_vars[key] = value['slug']
elif key == 'packet_tags': elif key == 'packet_tags':