QE ACK ..
curl -X POST --user "un:pw" "http://<server>:3005/api/storage_snapshots?format=xml" Required parameter 'volume_id' not found in [format] ----------------- > From: [email protected] > To: [email protected] > Sent: Monday, August 13, 2012 9:31:32 AM > Subject: [PATCH core 2/2] EC2: Fix storage_volumes not return exception on > unknown id > > From: Michal Fojtik <[email protected]> > > * When non-exist storage_volume id was used, the storage_volumes > returned exception instead of empty arr. > > Signed-off-by: Michal fojtik <[email protected]> > --- > server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb > b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb > index 79dd9d2..551bed9 100644 > --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb > +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb > @@ -627,11 +627,19 @@ module Deltacloud > > def storage_snapshots(credentials, opts={}) > ec2 = new_client(credentials) > - snapshot_list = (opts and opts[:id]) ? [opts[:id]] : [] > + snapshot_list = opts[:id] ? [opts[:id]] : [] > safely do > + begin > ec2.describe_snapshots(snapshot_list).collect do > |snapshot| > convert_snapshot(snapshot) > end > + rescue => e > + if e.message =~ /NotFound/ > + [] > + else > + raise e > + end > + end > end > end > > -- > 1.7.10.2 > >
