Fix packet.net dynamic inventory projects limit. (#64889)

* Added parameters to list more than 10 projects per run

* Fix slug issue due to packet api change. Same as https://github.com/ansible/ansible/pull/63916
pull/67442/head
Vitaly Shestovskiy 4 years ago committed by GitHub
parent f978b6c789
commit 95d4908987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -249,9 +249,14 @@ class PacketInventory(object):
def get_projects(self):
'''Makes a Packet API call to get the list of projects'''
params = {
'per_page': self.items_per_page
}
try:
manager = self.connect()
projects = manager.list_projects()
projects = manager.list_projects(params=params)
return projects
except Exception as e:
traceback.print_exc()
@ -351,7 +356,7 @@ class PacketInventory(object):
# Inventory: Group by OS
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:
self.push_group(self.inventory, 'operating_systems', device.operating_system.slug)
@ -400,7 +405,7 @@ class PacketInventory(object):
elif key == 'packet_facility':
device_vars[key] = value['code']
elif key == 'packet_operating_system':
device_vars[key] = value.slug
device_vars[key] = value['slug']
elif key == 'packet_plan':
device_vars[key] = value['slug']
elif key == 'packet_tags':

Loading…
Cancel
Save