Skip to content
This repository has been archived by the owner on Feb 2, 2018. It is now read-only.

Commit

Permalink
containermgr: Implement remove_all_nodes() for Kubernetes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarnes authored and ashcrow committed Feb 24, 2017
1 parent 4689cb3 commit 9da6c1a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/commissaire/containermgr/kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,27 @@ def remove_node(self, name):
resp = self._delete(part)
if resp.status_code != 200:
error_msg = (
'Unexpected response when trying to remove the node {}.'
'Unexpected response when trying to remove the node {}. '
'Status: {}, Data: {}'.format(
name, resp.status_code, resp.text))
self.logger.error(error_msg)
raise ContainerManagerError(error_msg, resp.status_code)

def remove_all_nodes(self):
"""
Removes all nodes from the Kubernetes Container Manager.
:raises: commissaire.containermgr.ContainerManagerError
"""
resp = self._delete('/nodes')
if resp.status_code != 200:
error_msg = (
'Unexpected response when trying to remove all nodes. '
'Status: {}, Data: {}'.format(
resp.status_code, resp.text))
self.logger.error(error_msg)
raise ContainerManagerError(error_msg, resp.status_code)

def node_registered(self, name):
"""
Checks is a node was registered.
Expand Down

0 comments on commit 9da6c1a

Please sign in to comment.