Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
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'])))
Esempio n. 4
0
    def test_stop_server(self):
        self._create_server()

        server = righteous.find_server(self.env)
        successful = righteous.stop_server(server['href'])
        assert successful
Esempio n. 5
0
 def stop_servers(self):
     if self.delete_server:
         server = righteous.find_server(self.env)
         if server:
             righteous.stop_server(server['href'])
Esempio n. 6
0
 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)
Esempio n. 7
0
    def test_stop_server(self):
        self._create_server()

        server = righteous.find_server(self.env)
        self.assertTrue(righteous.stop_server(server['href']))