PageRenderTime 173ms CodeModel.GetById 70ms app.highlight 2ms RepoModel.GetById 69ms app.codeStats 0ms

/silverlining/commands/destroy_node.py

https://bitbucket.org/ianb/silverlining/
Python | 15 lines | 10 code | 2 blank | 3 comment | 5 complexity | b2261960c02401cfaf110423db821ed7 MD5 | raw file
 1"""Destroy a server/node"""
 2
 3
 4def command_destroy_node(config):
 5    ## FIXME: This doesn't work at all, wtf?
 6    for node_hostname in config.args.nodes:
 7        ## FIXME: should update /etc/hosts
 8        for node in config.driver.list_nodes():
 9            if node.name == node_hostname:
10                config.logger.notify('Destroying node %s' % node.name)
11                node.destroy()
12                break
13        else:
14            config.logger.warn('No node found with the name %s' %
15                               node_hostname)