Michael Pasternak has uploaded a new change for review.

Change subject: cli: valid UUIDs are treated as syntax error #854391
......................................................................

cli: valid UUIDs are treated as syntax error #854391

https://bugzilla.redhat.com/show_bug.cgi?id=854391

Change-Id: Ie46e4f959d80e7e35a33b419e1f52424cd464956
Signed-off-by: Michael Pasternak <[email protected]>
---
M src/cli/parser.py
1 file changed, 8 insertions(+), 2 deletions(-)


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

diff --git a/src/cli/parser.py b/src/cli/parser.py
index 9ed91eb..0e5f921 100644
--- a/src/cli/parser.py
+++ b/src/cli/parser.py
@@ -29,7 +29,7 @@
     multi-line inputs.
     """
 
-    tokens = ('WORD', 'STRING', 'NUMBER', 'OPTION', 'LT', 'LTLT', 'GT', 'GTGT',
+    tokens = ('UUID', 'WORD', 'STRING', 'NUMBER', 'OPTION', 'LT', 'LTLT', 
'GT', 'GTGT',
               'BANG', 'PIPE', 'NEWLINE', 'MARKER', 'HEREDOC', 'SHELL')
     literals = ('=', ';')
     states = [('heredoc1', 'inclusive'), ('heredoc2', 'exclusive'),
@@ -46,6 +46,11 @@
     t_ignore_quoted_newline = r'\\\n'
     t_heredoc2_ignore = ' \t'
     t_shell_ignore = ' \t'
+
+    def t_UUID(self, t):
+        r'[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}'
+        t.value = str(t.value)
+        return t
 
     def t_STRING(self, t):
         r'''(?s)("([^"\\]|\\.)*"|'[^']*')'''
@@ -190,7 +195,8 @@
             p[0] = (p[1], p[3])
 
     def p_option_value(self, p):
-        """option_value : WORD
+        """option_value : UUID
+                        | WORD
                         | STRING
                         | NUMBER
                         | empty


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

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