Changing how get_one returns

This commit is contained in:
John Westcott IV
2020-09-08 11:02:25 -04:00
parent 106157c600
commit 0a8db586d1
25 changed files with 76 additions and 100 deletions

View File

@@ -108,7 +108,7 @@ def main():
inventory_id = module.resolve_name_to_id('inventories', inventory)
# Attempt to look up the object based on the provided name and inventory ID
group, name = module.get_one('groups', name_or_id=name, **{
group = module.get_one('groups', name_or_id=name, **{
'data': {
'inventory': inventory_id
}
@@ -120,7 +120,7 @@ def main():
# Create the data that gets sent for create and update
group_fields = {
'name': new_name if new_name else name,
'name': new_name if new_name else (module.get_item_name(group) if group else name),
'inventory': inventory_id,
}
if description is not None:
@@ -135,7 +135,7 @@ def main():
continue
id_list = []
for sub_name in name_list:
sub_obj, sub_name = module.get_one(resource, name_or_id=sub_name, **{
sub_obj = module.get_one(resource, name_or_id=sub_name, **{
'data': {'inventory': inventory_id},
})
if sub_obj is None: