Ravi Nori has uploaded a new change for review.

Change subject: cli: x-identifier auto-completion doesn't work in 
permissions(#1027281)
......................................................................

cli: x-identifier auto-completion doesn't work in permissions(#1027281)

group and user autocompletion options needs to
group-identifier and user-identifier in
permissions autocompletions

Change-Id: I9fe5494b89f6e7a9735ba3696052ff4f8d71b2a8
Bug-Url: https://bugzilla.redhat.com/1027281
Signed-off-by: Ravi Nori <[email protected]>
---
M src/ovirtcli/utils/autocompletionhelper.py
1 file changed, 18 insertions(+), 2 deletions(-)


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

diff --git a/src/ovirtcli/utils/autocompletionhelper.py 
b/src/ovirtcli/utils/autocompletionhelper.py
index 37146fe..5f3fb5d 100644
--- a/src/ovirtcli/utils/autocompletionhelper.py
+++ b/src/ovirtcli/utils/autocompletionhelper.py
@@ -58,11 +58,11 @@
     def _resolve_value(val, common_options=[], specific_options={}, 
specific_arguments={}):
         return val + (
               '-identifier ' if val not in common_options \
-                                and (not 
AutoCompletionHelper._is_verb_in_dict_values(
+                                and (not 
AutoCompletionHelper._is_verb_in_dict_values_exact_match(
                                               specific_options, val
                                               )
                                     )
-                                and (not 
AutoCompletionHelper._is_verb_in_dict_values(
+                                and (not 
AutoCompletionHelper._is_verb_in_dict_values_exact_match(
                                               specific_arguments, val
                                               )
                                     )
@@ -70,6 +70,22 @@
         )
 
     @staticmethod
+    def _get_verb_replecations_exact_match(container, text):
+        times = 0
+        for f in container:
+            if text and f == text:
+                times += 1
+                if times > 2: break
+        return times
+
+    @staticmethod
+    def _is_verb_in_dict_values_exact_match(dct, text):
+        for key in dct.keys():
+            if 
AutoCompletionHelper._get_verb_replecations_exact_match(dct[key], text) > 0:
+                return True
+        return False
+
+    @staticmethod
     def _get_verb_replecations(container, text):
         times = 0
         for f in container:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fe5494b89f6e7a9735ba3696052ff4f8d71b2a8
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