Skip to content
Permalink
Browse files

fix: early validation

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 3bb8cf7e52df2a9631efd41f17e17aab7a0a5417
Showing with 3 additions and 3 deletions.
  1. +2 −2 bin/quads-cli
  2. +1 −1 quads/tools/validate_env.py
@@ -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)

@@ -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:

0 comments on commit 3bb8cf7

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