hasattr can swallow exceptions. I suggest
=== modified file 'bin/euca-describe-volumes' --- bin/euca-describe-volumes 2009-10-12 09:11:57 +0000 +++ bin/euca-describe-volumes 2010-02-06 00:15:08 +0000 @@ -73,8 +73,11 @@ volume_string += '\t%s' % (volume.snapshot_id) else: volume_string += '\t' - if volume.availabilityZone: - volume_string += '\t%s' % volume.availabilityZone + + az = getattr(volume, 'availabilityZone', object) + if az is object: az=volume.zone + if az: volume_string += '\t%s' % az + volume_string += '\t%s\t%s' % (volume.status, volume.create_time) print 'VOLUME\t%s' % (volume_string) if volume.status == 'in-use':
hasattr can swallow exceptions. I suggest
=== modified file 'bin/euca- describe- volumes' describe- volumes 2009-10-12 09:11:57 +0000 describe- volumes 2010-02-06 00:15:08 +0000 snapshot_ id) availabilityZon e: availabilityZon e
--- bin/euca-
+++ bin/euca-
@@ -73,8 +73,11 @@
volume_string += '\t%s' % (volume.
else:
volume_string += '\t'
- if volume.
- volume_string += '\t%s' % volume.
+
+ az = getattr(volume, 'availabilityZone', object)
+ if az is object: az=volume.zone
+ if az: volume_string += '\t%s' % az
+
volume_string += '\t%s\t%s' % (volume.status, volume.create_time)
print 'VOLUME\t%s' % (volume_string)
if volume.status == 'in-use':