[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a

Garrett Holmstrom gholms at fedoraproject.org
Sun Jun 16 02:29:55 UTC 2013


The following commit has been merged in the master branch:
commit 1dc9e006be1988109bcd3a531444ff1aaa7e1cb6
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Mon May 21 19:53:20 2012 -0700

    Make DescribeSnapshots default to self-restorable

diff --git a/euca2ools/commands/euca/describesnapshots.py b/euca2ools/commands/euca/describesnapshots.py
index b1aec64..82b9703 100644
--- a/euca2ools/commands/euca/describesnapshots.py
+++ b/euca2ools/commands/euca/describesnapshots.py
@@ -34,11 +34,15 @@ from . import EucalyptusRequest
 
 class DescribeSnapshots(EucalyptusRequest):
     APIVersion = '2010-08-31'
-    Description = 'Display information about snapshots'
+    Description = '''\
+        Show information about snapshots
+
+        By default, only snapshots explicitly restorable by the caller are
+        shown.'''
     Args = [Arg('SnapshotId', nargs='*', metavar='SNAPSHOT',
                 help='limit results to specific snapshots'),
-            # noop for a little ec2dsnap compatibility
-            Arg('--all', action='store_true', route_to=None, help=SUPPRESS),
+            Arg('-a', '--all', action='store_true', route_to=None,
+                help='describe all snapshots'),
             Arg('-o', '--owner', dest='Owner', metavar='ACCOUNT',
                 action='append', default=[],
                 help='limit results to snapshots owned by specific accounts'),
@@ -62,6 +66,20 @@ class DescribeSnapshots(EucalyptusRequest):
     ListMarkers = ['snapshotSet', 'tagSet']
     ItemMarkers = ['item']
 
+    def main(self):
+        if not any(self.args.get(item) for item in ('all', 'Owner',
+                                                    'RestorableBy')):
+            # Default to restorable snapshots
+            self.args['RestorableBy'] = ['self']
+        elif self.args.get('all'):
+            if self.args.get('Owner'):
+                self._cli_parser.error('argument -a/--all: not allowed with '
+                                       'argument -o/--owner')
+            if self.args.get('RestorableBy'):
+                self._cli_parser.error('argument -a/--all: not allowed with '
+                                       'argument -r/--restorable-by')
+        return self.send()
+
     def print_result(self, result):
         for snapshot in result.get('snapshotSet', []):
             self.print_snapshot(snapshot)

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list