Skip to content
Permalink
Browse files

fix: default cloud on host info for future dates plus ls-cc-users

we were not correctly displaying the cloud when host moves out of
assignment.
for cc-users we were using the wrong mongo document for getting
current schedules.

fixes:
#285
#284

Change-Id: I94b47ba50f637f362a8e2d98a2a363bc790d1c77
  • Loading branch information...
grafuls committed Oct 8, 2019
1 parent b64967d commit ece5fef67cbfe04e78f3bca47dcd46eb01a5afae
Showing with 7 additions and 4 deletions.
  1. +5 −2 bin/quads-cli
  2. +2 −2 quads/api_v2.py
@@ -80,7 +80,10 @@ def main(_args):
data = quads.get(_args.action)
if data:
for k in data:
logger.info(str(k['name']) + ": " + str(k[_args.action]))
if isinstance(k[_args.action], list):
logger.info(str(k['name']) + ": " + str(", ".join(k[_args.action])))
else:
logger.info(str(k['name']) + ": " + str(k[_args.action]))
exit(0)

if _args.action == 'interface':
@@ -434,7 +437,7 @@ def main(_args):
for schedule in schedules:
logger.info(schedule.cloud.name)
else:
logger.info(_host.cloud.name)
logger.info(_host.default_cloud.name)
else:
logger.info('Unknown host: %s' % _args.host)
exit(1)
@@ -92,10 +92,10 @@ def GET(self, **data):
return json.dumps({"result": ["Nothing to do."]})
return _host.to_json()
if self.name == "ccuser":
_clouds = model.Cloud.objects().all()
_clouds = self.model.objects().all()
clouds_summary = []
for cloud in _clouds:
count = self.model.current_schedule(cloud=cloud).count()
count = model.Schedule.current_schedule(cloud=cloud).count()
clouds_summary.append(
{
"name": cloud.name,

0 comments on commit ece5fef

Please sign in to comment.
You can’t perform that action at this time.