Ravi Nori has uploaded a new change for review.

Change subject: cli: wrong error message appears after running 'show event --id 
<wrong id>'
......................................................................

cli: wrong error message appears after running 'show event --id <wrong id>'

wrong error message appears after running 'show event --id <wrong id>'

show event --id foo

Shows error meesage error: event "['foo']" does not exist.

It should be error: event 'foo' does not exist.

Change-Id: I8184e083d9dcc84ca42282046c76513032590b03
Bug-Url: https://bugzilla.redhat.com/980855
Signed-off-by: Ravi Nori <[email protected]>
---
M src/cli/messages.py
M src/ovirtcli/command/show.py
2 files changed, 8 insertions(+), 2 deletions(-)


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

diff --git a/src/cli/messages.py b/src/cli/messages.py
index 157c6d7..1ce9a05 100644
--- a/src/cli/messages.py
+++ b/src/cli/messages.py
@@ -19,7 +19,7 @@
     class Error():
         OBJECT_IS_IMMUTABLE = '%s "%s" is immutable.'
         NO_SUCH_OPTION = 'option "%s" is not supported, see help for more 
details.'
-        NO_SUCH_OBJECT = '%s "%s" does not exist.'
+        NO_SUCH_OBJECT = '%s %s does not exist.'
         NO_SUCH_ACTION = 'action "%s" does not exist in this context.'
         NO_SUCH_TYPE = 'type "%s" does not exist.'
         NO_SUCH_CONTEXT = 'cannot find any context for type "%s" using given 
arguments.'
diff --git a/src/ovirtcli/command/show.py b/src/ovirtcli/command/show.py
index 1456759..c557386 100644
--- a/src/ovirtcli/command/show.py
+++ b/src/ovirtcli/command/show.py
@@ -138,11 +138,17 @@
         if not (obj):
             self.error(Messages.Error.NO_SUCH_OBJECT %
                        (args[0], args[1] if len(args) > 1
-                                         else opts.values()
+                                         else self.get_object_id(opts.values())
                                               if opts else ''))
 
         self.context.formatter.format(self.context, obj)
 
+    def get_object_id(self, opts_values):
+        """Get Object Identifier."""
+        if len(opts_values) == 1:
+           return opts_values[0]
+        return opts_values
+
     def show_help(self):
         """Show help for "show"."""
         self.check_connection()


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

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

Reply via email to