Skip to content
Open
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
6 changes: 5 additions & 1 deletion atlasapi/atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ def pause_cluster(self, cluster: str, toggle_if_paused: bool = False) -> dict:
elif existing_config.paused is True and toggle_if_paused is True:
logger.warning('Cluster is paused, will toggle to unpaused, since toggle_if paused is true')
new_config = dict(paused=False)
else:
elif toggle_if_paused is False:
new_config = dict(paused=True)
else:
logger.error("The cluster is unpaused. No need to unpause again.")
raise ErrAtlasBadRequest(400,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel there is no need to raise an exception, but I am not sure what to return.
MGM?

{'msg': 'The cluster is already unpaused. No need to unpause again.'})
return self.modify_cluster(cluster=cluster, cluster_config=new_config)

def test_failover(self, cluster: str) -> Optional[dict]:
Expand Down