Skip to content
Permalink
Browse files

fix: resetting cloud on host object after rm-schedule

when removing a schedule we were not updating the host object to
go back to it's default cloud.

Change-Id: I1f8f4d74742a6359d26139dff7d97346fa36c6b6
  • Loading branch information
grafuls committed Dec 2, 2019
1 parent 2f5c19b commit 83391f70865092f20bd6ddf846d0a46df726932d
Showing with 3 additions and 0 deletions.
  1. +2 −0 quads/api_v2.py
  2. +1 −0 quads/tools/validate_env.py
@@ -419,6 +419,8 @@ def DELETE(self, **data):
_host = model.Host.objects(name=data["host"]).first()
if _host:
schedule = self.model.objects(host=_host, index=data["index"])
if self.model.current_schedule(host=_host, cloud=schedule.cloud):
_host.update(cloud=_host.default_cloud)
if schedule:
schedule.delete()
cherrypy.response.status = "204 No Content"
@@ -24,6 +24,7 @@ def __init__(self, cloud):
self.cloud = cloud
self.report = ""
self.hosts = Host.objects(cloud=self.cloud)
self.hosts = [host for host in self.hosts if Schedule.current_schedule(host=host)]

def notify_failure(self):
template_file = "validation_failed"

0 comments on commit 83391f7

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