Juan Hernandez has uploaded a new change for review.

Change subject: cli: Generate empty list for empty option
......................................................................

cli: Generate empty list for empty option

Currently when a command receives an option that represents a list of
values but without any value the CLI automatically adds the string
"None" as the only value. This can cause issues. What the CLI should
generate in this cases is an empty list.

Change-Id: Ic95dadcbfd7f77b49524df0ffd05dcdcf7af8f1e
Bug-Url: https://bugzilla.redhat.com/1085463
Signed-off-by: Juan Hernandez <[email protected]>
---
M src/ovirtcli/command/command.py
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/src/ovirtcli/command/command.py b/src/ovirtcli/command/command.py
index 43acd74..bd8b386 100644
--- a/src/ovirtcli/command/command.py
+++ b/src/ovirtcli/command/command.py
@@ -98,8 +98,9 @@
             return param
 
     def __do_set_primitive_list_data(self, obj, prop, val):
-        for param in self.__split_with_escape(str(val), delimiter=','):
-            getattr(obj, prop).append(param)
+        if val is not None:
+            for param in self.__split_with_escape(str(val), delimiter=','):
+                getattr(obj, prop).append(param)
 
     def __do_set_data(self, obj, prop, fq_prop, val):
         """INTERNAL: set data in to object based on 'prop' map segmentation"""


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

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

Reply via email to