mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 11:55:04 -02:30
Changing how get_one returns
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user