mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 01:17:35 -02:30
Changing how get_one returns
This commit is contained in:
@@ -104,7 +104,7 @@ def main():
|
||||
inventory_id = module.resolve_name_to_id('inventories', inventory)
|
||||
|
||||
# Attempt to look up host based on the provided name and inventory ID
|
||||
host, name = module.get_one('hosts', name_or_id=name, **{
|
||||
host = module.get_one('hosts', name_or_id=name, **{
|
||||
'data': {
|
||||
'inventory': inventory_id
|
||||
}
|
||||
@@ -116,7 +116,7 @@ def main():
|
||||
|
||||
# Create the data that gets sent for create and update
|
||||
host_fields = {
|
||||
'name': new_name if new_name else name,
|
||||
'name': new_name if new_name else (module.get_item_name(host) if host else name),
|
||||
'inventory': inventory_id,
|
||||
'enabled': enabled,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user