Skip to content
Permalink
Browse files

feat: added date arg for move-hosts dry-run

closes: #299
Change-Id: I2b61bb2377ca2fdcca0b27aa8d0f0749b3481ec4
  • Loading branch information
grafuls committed Nov 29, 2019
1 parent 86acf15 commit 2f5c19b0268e312e507e02fa9a3799fe498821fd
Showing with 6 additions and 2 deletions.
  1. +6 −2 quads/api_v2.py
@@ -32,7 +32,11 @@ def _get_obj(self, obj):

@cherrypy.expose
class MovesMethodHandler(MethodHandlerBase):
def GET(self):
def GET(self, **data):
date = datetime.datetime.now()
if "date" in data:
date = datetime.datetime.strptime(data["date"], "%Y-%m-%dt%H:%M:%S")

if self.name == "moves":
try:
_hosts = model.Host.objects()
@@ -42,7 +46,7 @@ def GET(self):

_scheduled_cloud = _host.default_cloud.name
_host_defined_cloud = _host.cloud.name
_current_schedule = self.model.current_schedule(host=_host).first()
_current_schedule = self.model.current_schedule(host=_host, date=date).first()
try:
if _current_schedule:
_scheduled_cloud = _current_schedule.cloud.name

0 comments on commit 2f5c19b

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