mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Fix a Django lookup type.
This commit is contained in:
parent
707c94f32d
commit
25174f955f
@ -272,12 +272,16 @@ class ExecutableJsonLoader(BaseLoader):
|
||||
|
||||
data = self.command_to_json([src, "--list"])
|
||||
|
||||
print "RAW: %s" % data
|
||||
|
||||
group = None
|
||||
|
||||
for (k,v) in data.iteritems():
|
||||
|
||||
group = self.get_group(k, all_group)
|
||||
|
||||
print "TYPE %s => %s" % (k, v)
|
||||
|
||||
if type(v) == dict:
|
||||
|
||||
# process hosts
|
||||
@ -290,6 +294,7 @@ class ExecutableJsonLoader(BaseLoader):
|
||||
group.add_host(host)
|
||||
if type(host_details) == list:
|
||||
for hk in host_details:
|
||||
print "?? getting host: %s" % hk
|
||||
host = self.get_host(hk)
|
||||
group.add_host(host)
|
||||
|
||||
@ -306,8 +311,10 @@ class ExecutableJsonLoader(BaseLoader):
|
||||
group.add_child_group(child)
|
||||
self.child_group_names[x] = child
|
||||
|
||||
if type(v) == list:
|
||||
if type(v) in (tuple, list):
|
||||
print "<><><><><><><><><><><><><><><><>><><><> GOT A LIST: %s" % (v)
|
||||
for x in v:
|
||||
print ">>>>>>>>> ADDING HOST FROM AN EXECUTABLE LIST = %s to %s" % (x, group.name)
|
||||
host = self.get_host(x)
|
||||
group.add_host(host)
|
||||
|
||||
@ -490,8 +497,8 @@ class Command(BaseCommand):
|
||||
# if overwrite is set, for each host in the database but NOT in the local
|
||||
# list, delete it
|
||||
if overwrite:
|
||||
LOGGER.info("deleting any hosts not in the remote source")
|
||||
Host.objects.exclude(name___in = host_names.keys()).delete()
|
||||
LOGGER.info("deleting any hosts not in the remote source: %s" % host_names.keys())
|
||||
Host.objects.exclude(name__in = host_names.keys()).delete()
|
||||
|
||||
# if overwrite is set, for each group in the database but NOT in the local
|
||||
# list, delete it
|
||||
|
Loading…
Reference in New Issue
Block a user