Skip to content
Permalink
Browse files

fix: cloud validation with all hosts ready validated

in the scenario of all hosts in a cloud been validated but the
cloud not being updated, it would fall into an endless loop of
validation failures due to self.hosts being empty.
if all hosts have already been validated we can ommit running these
host bounded validations for validating the cloud.

Change-Id: I994d879887a774c2a043fa8d629f71c81e22ae1a
  • Loading branch information
grafuls committed Feb 3, 2020
1 parent b624aea commit 962ef89ae02f283e2022ec61fc93f69b7d8c0c66
Showing with 21 additions and 8 deletions.
  1. +11 −0 quads/templates/validation_succeeded
  2. +10 −8 quads/tools/validate_env.py
@@ -0,0 +1,11 @@
A post allocation check previously failed for:

cloud: {{ cloud }}
owner: {{ owner }}
ticket: {{ ticket }}

has successfully passed the verification test(s)! The owner
should receive a notification that the environment is ready
for use.

DevOps Team
@@ -172,24 +172,26 @@ def validate_env(self):
failed = False

if self.env_allocation_time_exceeded():
if not self.post_system_test():
failed = True
if self.hosts:
if not self.post_system_test():
failed = True

if not self.post_network_test():
failed = True
if not self.post_network_test():
failed = True

# TODO: gather ansible-cmdb facts

# TODO: quads dell config report

if not failed and not notification_obj.success:
self.notify_success()
notification_obj.update(success=True, fail=False)

if not failed:
for host in self.hosts:
host.update(validated=True)
self.cloud.update(validated=True)

if not notification_obj.success:
self.notify_success()
notification_obj.update(success=True, fail=False)

if failed and not notification_obj.fail:
self.notify_failure()
notification_obj.update(fail=True)

0 comments on commit 962ef89

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