Skip to content

Commit

Permalink
fix: early validation
Browse files Browse the repository at this point in the history
moved validated definition from move action from old cloud to new
cloud.
added provisioned filter on validate_env.

closes: #307
Change-Id: Ibf95110355f3370cae7d27be4c154e6cff0593a1
  • Loading branch information
grafuls committed Feb 4, 2020
1 parent 962ef89 commit 3bb8cf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/quads-cli
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,12 @@ def main(_args):

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

_old_cloud_obj = Cloud.objects(name=results[0]["current"]).first()
old_cloud_schedule = Schedule.current_schedule(cloud=_old_cloud_obj)
if not old_cloud_schedule and _old_cloud_obj.name != "cloud01":
_old_cloud_obj.update(provisioned=False, validated=False, vlan=None, wipe=True, ccuser=[])
_old_cloud_obj.update(provisioned=False, vlan=None, wipe=True, ccuser=[])

exit(0)

Expand Down
2 changes: 1 addition & 1 deletion quads/tools/validate_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def validate_env(self):

logging.basicConfig(level=level, format="%(message)s")

clouds = Cloud.objects(validated=False, name__ne="cloud01")
clouds = Cloud.objects(validated=False, provisioned=True, name__ne="cloud01")
for _cloud in clouds:
_schedule_count = Schedule.current_schedule(cloud=_cloud).count()
if _schedule_count and _cloud.wipe:
Expand Down

0 comments on commit 3bb8cf7

Please sign in to comment.