1
2
3 from completers import ClusterCompleter
4
5
7 """
8 addnode [options] <cluster_tag>
9
10 Add a node to a running cluster
11
12 Example:
13
14 $ starcluster addnode mynewcluster
15
16 This will add a new node to mynewcluster. To give the node an alias:
17
18 $ starcluster addnode -a mynode mynewcluster
19 """
20 names = ['addnode', 'an']
21
22 tag = None
23
25 parser.add_option("-a", "--alias", dest="alias",
26 action="store", type="string", default=None,
27 help=("alias to give to the new node " + \
28 "(e.g. node007, mynode, etc)"))
29
31 if len(args) != 1:
32 self.parser.error("please specify a cluster <cluster_tag>")
33 tag = self.tag = args[0]
34 aliases = None
35 if self.opts.alias:
36 aliases = [self.opts.alias]
37 self.cm.add_node(tag, aliases)
38