starcluster.commands.removenode

Package starcluster :: Package commands :: Module removenode |
[hide private]
[frames] | no frames]

# Source Code for Module starcluster.commands.removenode

     1  #!/usr/bin/env python
     2
     3  from completers import ClusterCompleter
     4
     5
     6 -class CmdRemoveNode(ClusterCompleter):
     7      """
     8      removenode [options] <cluster_tag> <node> [<node> ...]
     9
    10      Terminate one or more nodes in the cluster
    11
    12      Example:
    13
    14          $ starcluster removenode mynewcluster node003
    15
    16      This will remove node003 from mynewcluster and terminate the node.
    17      """
    18      names = ['removenode', 'rn']
    19
    20      tag = None
    21
    22 -    def execute(self, args):
    23          if not len(args) >= 2:
    24              self.parser.error("please specify a <cluster_tag> and <node>")
    25          tag = self.tag = args[0]
    26          aliases = args[1:]
    27          for alias in aliases:
    28              self.cm.remove_node(tag, alias)
    29