/silverlining/commands/destroy_node.py

https://bitbucket.org/ianb/silverlining/ · Python · 15 lines · 10 code · 2 blank · 3 comment · 4 complexity · b2261960c02401cfaf110423db821ed7 MD5 · raw file

  1. """Destroy a server/node"""
  2. def command_destroy_node(config):
  3. ## FIXME: This doesn't work at all, wtf?
  4. for node_hostname in config.args.nodes:
  5. ## FIXME: should update /etc/hosts
  6. for node in config.driver.list_nodes():
  7. if node.name == node_hostname:
  8. config.logger.notify('Destroying node %s' % node.name)
  9. node.destroy()
  10. break
  11. else:
  12. config.logger.warn('No node found with the name %s' %
  13. node_hostname)