~ubuntu-branches/ubuntu/maverick/euca2ools/maverick-updates

« back to all changes in this revision

Viewing changes to bin/euca-describe-instances

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland, Scott Moser, Dustin Kirkland
  • Date: 2010-03-25 15:36:43 UTC
  • Revision ID: james.westby@ubuntu.com-20100325153643-f43twxyyj52gvpqt
Tags: 1.2-0ubuntu8
[ Scott Moser ]
* euca-run-instances:
  - --keypair => --key in usage and man page, LP: #530816
  - print error rather than trace on invalid instance-count, LP: #546420
  - euca-describe-instances: output "running", not "running ", LP: #531453
* euca-revoke: only show usage once with --help
* euca-download-bundle: fix usage, LP: #546567
* euca-bundle-image:
  - fix failure on --block-device-mapping, LP: #546548
  - print usage on --help if userid has '-', LP: #546526
  - fix failure when image name string is in dest string, LP: #522060
* euca-describe-image-attribute: fix --kernel or --ramdisk when
  image did not have emi or eri, LP: #546551

[ Dustin Kirkland ]
* Cherry-pick up to upstream r266, fixes:
  - LP: #536876 - document euca-describe-availability-zones verbose
  - LP: #526591 - enhance parsing of config file
  - LP: #531076 - fix euca-describe-images against specific image

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
# Author: Neil Soman neil@eucalyptus.com
34
34
 
35
35
import getopt, sys, os
36
 
from euca2ools import Euca2ool, InstanceValidationError, Util, ConnectionFailed
 
36
from euca2ools import Euca2ool, InstanceValidationError, Util, ConnectionFailed, print_instances
37
37
 
38
38
usage_string = """
39
39
Shows information about instances.
77
77
            reservation_string += '%s%s' % (group_delim, group.id)
78
78
            group_delim = ', '
79
79
        print 'RESERVATION\t%s' % (reservation_string) 
80
 
        for instance in instances:
81
 
            if instance:
82
 
                instance_string = '%s\t%s\t%s\t%s\t%s'  % (instance.id, instance.image_id, instance.public_dns_name, instance.private_dns_name, instance.state) 
83
 
                if instance.key_name:
84
 
                    instance_string += ' \t%s' % instance.key_name
85
 
                if instance.ami_launch_index:
86
 
                    instance_string += ' \t%s' % instance.ami_launch_index
87
 
                if instance.product_codes:
88
 
                    first = True
89
 
                    for p in instance.product_codes:
90
 
                        if first:
91
 
                            instance_string += ' \t%s' % p
92
 
                            first = False
93
 
                        else:
94
 
                            instance_string += ',%s' % p
95
 
                if instance.instance_type:
96
 
                    instance_string += ' \t%s' % instance.instance_type
97
 
                if instance.launch_time:
98
 
                    instance_string += ' \t%s' % instance.launch_time
99
 
                if instance.placement:
100
 
                    instance_string += ' \t%s' % instance.placement
101
 
                if instance.kernel:
102
 
                    instance_string += ' \t%s' % instance.kernel
103
 
                if instance.ramdisk:
104
 
                    instance_string += ' \t%s' % instance.ramdisk
105
 
                print 'INSTANCE\t%s' % (instance_string)
 
80
 
 
81
        print_instances(instances)
106
82
 
107
83
def main():
108
84
    euca = None