~ubuntu-branches/ubuntu/natty/euca2ools/natty-201106142030

« back to all changes in this revision

Viewing changes to bin/euca-describe-instances

  • Committer: Scott Moser
  • Date: 2010-11-17 21:23:16 UTC
  • Revision ID: smoser@ubuntu.com-20101117212316-is94e55u3jv46y9l
move to quilt 3.0 source format, re-apply all relevant delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
import sys
38
38
import os
39
39
from euca2ools import Euca2ool, InstanceValidationError, Util, \
40
 
    ConnectionFailed
 
40
    ConnectionFailed, print_instances
41
41
 
42
42
usage_string = \
43
43
    """
85
85
            reservation_string += '%s%s' % (group_delim, group.id)
86
86
            group_delim = ', '
87
87
        print 'RESERVATION\t%s' % reservation_string
88
 
        for instance in instances:
89
 
            if instance:
90
 
                instance_string = '%s\t%s\t%s\t%s\t%s' % (instance.id,
91
 
                        instance.image_id, instance.public_dns_name,
92
 
                        instance.private_dns_name, instance.state)
93
 
                if instance.key_name:
94
 
                    instance_string += ' \t%s' % instance.key_name
95
 
                if instance.ami_launch_index:
96
 
                    instance_string += ' \t%s' \
97
 
                        % instance.ami_launch_index
98
 
                if instance.product_codes:
99
 
                    first = True
100
 
                    for p in instance.product_codes:
101
 
                        if first:
102
 
                            instance_string += ' \t%s' % p
103
 
                            first = False
104
 
                        else:
105
 
                            instance_string += ',%s' % p
106
 
                if instance.instance_type:
107
 
                    instance_string += ' \t%s' % instance.instance_type
108
 
                if instance.launch_time:
109
 
                    instance_string += ' \t%s' % instance.launch_time
110
 
                if instance.placement:
111
 
                    instance_string += ' \t%s' % instance.placement
112
 
                if instance.kernel:
113
 
                    instance_string += ' \t%s' % instance.kernel
114
 
                if instance.ramdisk:
115
 
                    instance_string += ' \t%s' % instance.ramdisk
116
 
                print 'INSTANCE\t%s' % instance_string
117
 
 
 
88
        print_instances(instances)
118
89
 
119
90
def main():
120
91
    euca = None