You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/03/14 19:19:03 UTC

[15/15] git commit: * server/lib/cimi/service/machine_template.rb (delete!): fix 500 error

Updated Branches:
  refs/heads/master a06672f7a -> 6779a572a


* server/lib/cimi/service/machine_template.rb (delete!): fix 500 error

The method was simply busted. Now also allows deletion of nonexisting
templates


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/89018059
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/89018059
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/89018059

Branch: refs/heads/master
Commit: 89018059c6cfd703ee6d68f12afcba499bf67740
Parents: d974429
Author: David Lutterkort <lu...@redhat.com>
Authored: Mon Mar 4 15:49:32 2013 -0800
Committer: David Lutterkort <lu...@redhat.com>
Committed: Wed Mar 13 17:28:13 2013 -0700

----------------------------------------------------------------------
 server/lib/cimi/service/machine_template.rb |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/89018059/server/lib/cimi/service/machine_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/machine_template.rb b/server/lib/cimi/service/machine_template.rb
index 4a3cd4e..837c519 100644
--- a/server/lib/cimi/service/machine_template.rb
+++ b/server/lib/cimi/service/machine_template.rb
@@ -29,7 +29,9 @@ class CIMI::Service::MachineTemplate < CIMI::Service::Base
     end
 
     def delete!(id, context)
-      current_db.machine_templates.first(:id => id).destroy
+      if mt = current_db.machine_templates_dataset.first(:id => id)
+          mt.destroy
+      end
     end
 
     def from_db(model, context)