Michael Pasternak has uploaded a new change for review.

Change subject: cli: fix RemoveCommand.name
......................................................................

cli: fix RemoveCommand.name

Change-Id: Iab8bf493f63d2fa1010ade4174d4ad61436e16ee
Signed-off-by: Michael Pasternak <[email protected]>
---
M src/ovirtcli/command/remove.py
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/34/8034/1

diff --git a/src/ovirtcli/command/remove.py b/src/ovirtcli/command/remove.py
index 2bc981b..1f18c58 100644
--- a/src/ovirtcli/command/remove.py
+++ b/src/ovirtcli/command/remove.py
@@ -22,8 +22,8 @@
 
 class RemoveCommand(OvirtCommand):
 
-    name = 'delete'
-    aliases = ('remove',)
+    name = 'remove'
+    aliases = ('delete',)
     description = 'removes an object'
     args_check = 2
     valid_options = [ ('*', str) ]
@@ -136,7 +136,7 @@
         args = self.arguments
         opts = self.options
 
-        typs = TypeHelper.get_types_containing_method(RemoveCommand.name,
+        typs = TypeHelper.get_types_containing_method(RemoveCommand.aliases[0],
                                                       expendNestedTypes=True,
                                                       groupOptions=True)
 
@@ -146,8 +146,8 @@
                                    context_variants=typs[args[0]])
         if resource is None:
             self.error(Messages.Error.NO_SUCH_OBJECT % (args[0], args[1]))
-        elif hasattr(resource, RemoveCommand.name):
-            result = self.execute_method(resource, RemoveCommand.name, opts)
+        elif hasattr(resource, RemoveCommand.aliases[0]):
+            result = self.execute_method(resource, RemoveCommand.aliases[0], 
opts)
         else:
             self.error(Messages.Error.OBJECT_IS_IMMUTABLE % (args[0], args[1]))
 
@@ -160,7 +160,7 @@
         opts = self.options
 
         subst = {}
-        types = TypeHelper.get_types_containing_method(RemoveCommand.name,
+        types = 
TypeHelper.get_types_containing_method(RemoveCommand.aliases[0],
                                                        expendNestedTypes=True,
                                                        groupOptions=True)
 
@@ -176,7 +176,7 @@
                     self.error(Messages.Error.NO_SUCH_OBJECT % (args[0], 
args[1]))
 
                 helptext = self.helptext1
-                params_list = self.get_options(method=RemoveCommand.name,
+                params_list = self.get_options(method=RemoveCommand.aliases[0],
                                                resource=obj,
                                                sub_resource=base,
                                                context_variants=types[args[0]])
@@ -187,7 +187,7 @@
                 helptext = self.helptext1
                 subst['type'] = args[0]
 
-                options = self.get_options(method=RemoveCommand.name,
+                options = self.get_options(method=RemoveCommand.aliases[0],
                                            resource=args[0],
                                            
sub_resource=self.resolve_base(self.options),
                                            context_variants=types[args[0]])


--
To view, visit http://gerrit.ovirt.org/8034
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab8bf493f63d2fa1010ade4174d4ad61436e16ee
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Michael Pasternak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to