Skip to content

Commit

Permalink
Ability to add or subtract value on workspace capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
predat committed Feb 19, 2016
1 parent 77798f6 commit 864598f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyIsis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,12 @@ def create_workspace(self, name='default_name', capacity=100, *options):
def update_workspace_capacity(self, name="", capacity=None):
workspace = self.get_workspace_details(name)
modify_workspace = copy.deepcopy(workspace)
modify_workspace.ioByteCount = int(capacity)
if '+' in capacity:
modify_workspace.ioByteCount = modify_workspace.ioByteCount + (int(capacity) * 1024)
elif '-' in capacity:
modify_workspace.ioByteCount = modify_workspace.ioByteCount - (int(capacity) * 1024)
else:
modify_workspace.ioByteCount = int(capacity)
return self._client.service.ModifyWorkspaceDetails(self.token,
workspace,
modify_workspace)
Expand Down

0 comments on commit 864598f

Please sign in to comment.