Update views and serializers to support instance group (ramparts)

* includes top level views for instances and instance groups and
  extending those views to be able to view running jobs
* Associative endpoints on Organizations, Inventories, and Job
  Templates
* Related and summary field entries where appropriate
* Adding job model references to executing instance group
* Fix up default queue properties for clustering from the settings file
* Update production and default settings for instance queues in settings
This commit is contained in:
Matthew Jones
2017-04-05 10:42:47 -04:00
parent 4ced911c00
commit 705f8af440
13 changed files with 303 additions and 34 deletions

View File

@@ -29,11 +29,11 @@ class Command(BaseCommand):
instance_list = [x.strip() for x in options.get('hostnames').split(",")]
for inst_name in instance_list:
instance = Instance.objects.filter(hostname=inst_name)
if instance.exists() and instance not in ig.instances:
ig.instances.add(instance)
print("Added instance {} to {}".format(instance, ig))
if instance.exists() and instance not in ig.instances.all():
ig.instances.add(instance[0])
print("Added instance {} to {}".format(instance[0], ig))
elif not instance.exists():
print("Instance does not exist: {}".format(instance))
print("Instance does not exist: {}".format(inst_name))
sys.exit(1)
else:
print("Instance already registered {}".format(instance))
print("Instance already registered {}".format(instance[0]))