starcluster.commands.sshmaster

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

# Source Code for Module starcluster.commands.sshmaster

     1  #!/usr/bin/env python
     2
     3  from completers import ClusterCompleter
     4
     5
     6 -class CmdSshMaster(ClusterCompleter):
     7      """
     8      sshmaster [options] <cluster>
     9
    10      SSH to a cluster's master node
    11
    12      Example:
    13
    14          $ sshmaster mycluster
    15      """
    16      names = ['sshmaster', 'sm']
    17
    18 -    def addopts(self, parser):
    19          parser.add_option("-u", "--user", dest="user", action="store",
    20                            type="string", default='root',
    21                            help="login as USER (defaults to root)")
    22
    23 -    def execute(self, args):
    24          if not args:
    25              self.parser.error("please specify a cluster")
    26          for arg in args:
    27              self.cm.ssh_to_master(arg, user=self.opts.user)
    28