starcluster.commands.listimages

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

# Source Code for Module starcluster.commands.listimages

     1  #!/usr/bin/env python
     2
     3  from base import CmdBase
     4
     5
     6 -class CmdListImages(CmdBase):
     7      """
     8      listimages [options]
     9
    10      List all registered EC2 images (AMIs)
    11      """
    12      names = ['listimages', 'li']
    13
    14 -    def addopts(self, parser):
    15          parser.add_option(
    16              "-x", "--executable-by-me", dest="executable",
    17              action="store_true", default=False,
    18              help=("Show images owned by other users that " +
    19                    "you have permission to execute"))
    20
    21 -    def execute(self, args):
    22          if self.opts.executable:
    23              self.ec2.list_executable_images()
    24          else:
    25              self.ec2.list_registered_images()
    26