Skip to content

Commit

Permalink
fix: cloud validation with all hosts ready validated
Browse files Browse the repository at this point in the history
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 962ef89
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
11 changes: 11 additions & 0 deletions quads/templates/validation_succeeded
Original file line number Diff line number Diff line change
@@ -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
18 changes: 10 additions & 8 deletions quads/tools/validate_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 962ef89

Please sign in to comment.