Skip to content
Permalink
Browse files

Fixes to progress bar display.

Additionally fixing the setting of an old cloud to validated false
even after assignment to new cloud is not succesfully completed.

Change-Id: Ic9ca2e02b09eeaf55ee7ffd47ddc9693d0b22ae1
  • Loading branch information...
grafuls committed Aug 5, 2019
1 parent 2977dbe commit ad4d5ccc15e701155478e7262e448f2229fadc4a
Showing with 27 additions and 13 deletions.
  1. +8 −5 bin/quads-cli
  2. +19 −8 quads/tools/create_input_assignments.py
@@ -373,13 +373,16 @@ def main(_args):
except Exception:
logger.exception('Move command failed for host: %s' % host)
provisioned = False

if not _args.dryrun and provisioned:
_new_cloud_obj = Cloud.objects(name=_cloud).first()
_new_cloud_obj.update(provisioned=True)
# TODO: Add logic here for setting host to validated=false
# if result["new"]==default_cloud

if not _args.dryrun:
if provisioned:
_new_cloud_obj = Cloud.objects(name=_cloud).first()
_new_cloud_obj.update(provisioned=True)
make_instackenv_json.main()
_old_cloud_obj = Cloud.objects(name=results[0]["current"]).first()
_old_cloud_obj.update(provisioned=False, validated=False, vlan=None, wipe=True)
make_instackenv_json.main()

exit(0)

@@ -31,7 +31,13 @@ def print_header():

def print_summary():
_summary = []
_headers = ["**NAME**", "**SUMMARY**", "**OWNER**", "**REQUEST**", "**STATUS**"]
_headers = [
'**NAME**',
'**SUMMARY**',
'**OWNER**',
'**REQUEST**',
'     **STATUS**    '
]
if conf["openstack_management"]:
_headers.append("**INSTACKENV**")
if conf["gather_ansible_facts"]:
@@ -60,9 +66,8 @@ def print_summary():
style_tag_start = '<span style="color:green">'
instack_link = os.path.join(conf["quads_url"], "cloud", "%s_instackenv.json" % cloud_name)
instack_text = "download"
status = '<span class="progress" style="margin-bottom:0px">\
<span role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%" \
class="progress-bar">100%</span></span>'
status = '<span class="progress" style="margin-bottom:0px"><span role="progressbar" aria-valuenow="100" ' \
'aria-valuemin="0" aria-valuemax="100" style="width:100%" class="progress-bar">100%</span></span> '
else:
cloud_obj = Cloud.objects(name=cloud_name).first()
scheduled_hosts = Schedule.current_schedule(cloud=cloud_obj).count()
@@ -71,10 +76,16 @@ def print_summary():
style_tag_start = '<span style="color:red">'
instack_link = "#"
instack_text = "validating"
classes = ["progress-bar", "progress-bar-striped", "progress-bar-warning", "active"]
status = '<span class="progress" style="margin-bottom:0px">\
<span role="progressbar" aria-valuenow="%.0f" aria-valuemin="0" aria-valuemax="100" style="width:%.0f%%" \
class="%s">%.0f%%</span></span>' % (percent, percent, " ".join(classes), percent)
if percent < 15:
classes = ["progress-bar", "progress-bar-striped", "progress-bar-danger", "active"]
status = '<span class="progress" style="margin-bottom:0px"><span role="progressbar" ' \
'aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%%" ' \
'class="%s">%.0f%%</span></span>' % (" ".join(classes), percent)
else:
classes = ["progress-bar", "progress-bar-striped", "progress-bar-warning", "active"]
status = '<span class="progress" style="margin-bottom:0px"><span role="progressbar" ' \
'aria-valuenow="%.0f" aria-valuemin="0" aria-valuemax="100" style="width:%.0f%%" ' \
'class="%s">%.0f%%</span></span>' % (percent, percent, " ".join(classes), percent)

_data = ["[%s%s%s](#%s)" % (style_tag_start, cloud_name, style_tag_end, cloud_name), desc, owner, link]

0 comments on commit ad4d5cc

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