in source/ecs/workspaces_helper.py [0:0]
def modify_workspace_properties(self, workspace_id, new_running_mode):
"""
This method changes the running mode of the workspace to the give new running mode.
:param workspace_id:
:param new_running_mode:
:return: Result code to indicate new running mode for the workspace
"""
log.debug('modifyWorkspaceProperties')
if not self.settings.get('isDryRun'):
try:
self.workspaces_client.modify_workspace_properties(
WorkspaceId=workspace_id,
WorkspaceProperties={'RunningMode': new_running_mode}
)
except Exception as e:
log.error('Exceeded retries for %s due to error: %s', workspace_id, e)
return '-E-' # return the status to indicate that the workspace was not processed.
else:
log.info('Skipping modifyWorkspaceProperties for Workspace %s due to dry run', workspace_id)
if new_running_mode == ALWAYS_ON:
result = '-M-'
else:
result = '-H-'
return result