1 from base import CmdBase 2 3 4 -class CmdListInstances(CmdBase): 5 """ 6 listinstances [options] 7 8 List all running EC2 instances 9 """ 10 names = ['listinstances', 'lsi'] 11 12 - def addopts(self, parser): 13 parser.add_option("-t", "--show-terminated", dest="show_terminated", 14 action="store_true", default=False, 15 help="show terminated instances") 16 17 - def execute(self, args): 18 self.ec2.list_all_instances(self.opts.show_terminated) 19