Skip to content

Commit

Permalink
fix: keep cloud validated state based on wipe
Browse files Browse the repository at this point in the history
hosts moving to a new cloud change the validated status of a
cloud to the opposite of it's wipe value.
if wipe=true -> validated=false
wipe=false -> validated=true

fixes: #320
Change-Id: Icc44d24d8d0aaad504ff56a4edbabe3c777e6a32
  • Loading branch information
grafuls committed Apr 20, 2020
1 parent f7a1d3e commit a0a2969
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/quads-cli
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def main(_args):
if not _args.dryrun:
if new != "cloud01":
has_active_schedule = Schedule.current_schedule(cloud=cloud)
if has_active_schedule:
if has_active_schedule and cloud.wipe:
cloud.update(validated=False)
try:
if _args.movecommand == default_move_command:
Expand Down Expand Up @@ -547,7 +547,8 @@ def main(_args):

if provisioned:
_new_cloud_obj = Cloud.objects(name=_cloud).first()
_new_cloud_obj.update(provisioned=True, validated=False)
validate = not _new_cloud_obj.wipe
_new_cloud_obj.update(provisioned=True, validated=validate)

_old_cloud_obj = Cloud.objects(name=results[0]["current"]).first()
old_cloud_schedule = Schedule.current_schedule(cloud=_old_cloud_obj)
Expand Down

0 comments on commit a0a2969

Please sign in to comment.