Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/devcenter/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
6.2.2
++++++
* Fix delay all and delay dev box/environment action if no next scheduled time

6.2.1
++++++
* Fix environment data plane command examples
Expand Down
8 changes: 6 additions & 2 deletions src/devcenter/azext_devcenter/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,9 @@ def devcenter_dev_box_delay_action(
"action_name": action_name
})

upcoming_action_time = upcoming_action["next"]["scheduledTime"]
upcoming_action_time = upcoming_action.get("next", {}).get("scheduledTime")
if not upcoming_action_time:
raise ResourceNotFoundError("There are no upcoming scheduled times for this action.")
action_time = datetime.strptime(upcoming_action_time, "%Y-%m-%dT%H:%M:%S.%fZ")
delayed_time = get_delayed_time(delay_time, action_time)

Expand Down Expand Up @@ -1673,7 +1675,9 @@ def devcenter_environment_delay_action(
"action_name": action_name
})

upcoming_action_time = upcoming_action["next"]["scheduledTime"]
upcoming_action_time = upcoming_action.get("next", {}).get("scheduledTime")
if not upcoming_action_time:
raise ResourceNotFoundError("There are no upcoming scheduled times for this action.")
action_time = datetime.strptime(upcoming_action_time, "%Y-%m-%dT%H:%M:%S.%fZ")
delayed_time = get_delayed_time(delay_time, action_time)

Expand Down
4 changes: 2 additions & 2 deletions src/devcenter/azext_devcenter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def get_project_data(cli_ctx, dev_center_name, project_name=None):
def get_earliest_time(action_iterator):
earliest_time = None
for action in action_iterator:
if action["next"] is not None:
action_string = action["next"]["scheduledTime"]
action_string = action.get("next", {}).get("scheduledTime")
if action_string:
action_time = datetime.strptime(action_string, "%Y-%m-%dT%H:%M:%S.%fZ")
if earliest_time is None or action_time < earliest_time:
earliest_time = action_time
Expand Down
2 changes: 1 addition & 1 deletion src/devcenter/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from setuptools import setup, find_packages

# HISTORY.rst entry.
VERSION = '6.2.1'
VERSION = '6.2.2'
try:
from azext_devcenter.manual.version import VERSION
except ImportError:
Expand Down
Loading