Model changes based on jobs API discussion, code and test fixes to work with those changes.

This commit is contained in:
Chris Church
2013-05-08 17:41:10 -04:00
parent 6238f0ab9a
commit f7cd605415
11 changed files with 638 additions and 110 deletions

View File

@@ -47,7 +47,7 @@ class Command(NoArgsCommand):
'children': list(group.children.values_list('name', flat=True)),
}
if group.variable_data is not None:
group_info['vars'] = json.loads(group.variable_data.data)
group_info['vars'] = group.variable_data.data
group_info = dict(filter(lambda x: bool(x[1]), group_info.items()))
if group_info.keys() in ([], ['hosts']):
@@ -66,7 +66,7 @@ class Command(NoArgsCommand):
raise CommandError('Host %s not found in the given inventory' % hostname)
hostvars = {}
if host.variable_data is not None:
hostvars = json.loads(host.variable_data.data)
hostvars = host.variable_data.data
self.stdout.write(json.dumps(hostvars, indent=indent))
def handle_noargs(self, **options):