def test_delete_server(self): self._create_server() server = righteous.find_server(self.env) self.assertTrue(righteous.stop_server(server['href'])) stopped = False while not stopped: server = righteous.find_server(self.env) stopped = server['state'] == 'stopped' self.assertTrue(righteous.delete_server(server['href'])) self.delete_server = False
def test_delete_server(self): self._create_server() server = righteous.find_server(self.env) successful = righteous.stop_server(server['href']) assert successful stopped = False while not stopped: server = righteous.find_server(self.env) stopped = server['state'] == 'stopped' successful = righteous.delete_server(server['href']) assert successful self.delete_server = False
def stop(arguments): initialise(arguments) for environment in arguments['<environment>']: answer = raw_input('Confirm decommission of %s [Y/n] ' % environment) if answer in ['n', 'no']: continue server = righteous.find_server(environment) success = righteous.stop_server(server['href']) if success: puts(colored.cyan('Initiated decommission of %s @ %s' % (environment, server['href']))) else: puts_err(colored.magenta('Error stopping server %s @ %s' % (environment, server['href'])))
def test_stop_server(self): self._create_server() server = righteous.find_server(self.env) successful = righteous.stop_server(server['href']) assert successful
def stop_servers(self): if self.delete_server: server = righteous.find_server(self.env) if server: righteous.stop_server(server['href'])
def test_stop_server(self): self.response.status_code = 201 assert righteous.stop_server('/my/ref') self.request.assert_called_once_with('/my/ref/stop', method='POST', prepend_api_base=False)
def test_stop_server(self): self._create_server() server = righteous.find_server(self.env) self.assertTrue(righteous.stop_server(server['href']))