Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: avoid lines in answer on None value
......................................................................

packaging: setup: avoid lines in answer on None value

Avoid writing None values to answerfiles to make it a cleaner.

Change-Id: Ic2d3a0feee695792ee34851deb5051202ed0c764
Bug-Url: https://bugzilla.redhat.com/1149904
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-common/base/core/answerfile.py
1 file changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/39074/1

diff --git 
a/packaging/setup/plugins/ovirt-engine-common/base/core/answerfile.py 
b/packaging/setup/plugins/ovirt-engine-common/base/core/answerfile.py
index 4bd76f2..40e0689 100644
--- a/packaging/setup/plugins/ovirt-engine-common/base/core/answerfile.py
+++ b/packaging/setup/plugins/ovirt-engine-common/base/core/answerfile.py
@@ -109,16 +109,17 @@
                                         k not in wlist
                                     ):
                                         v = self.environment[k]
-                                        f.write(
-                                            '%s=%s:%s\n' % (
-                                                k,
-                                                common.typeName(v),
-                                                '\n'.join(v)
-                                                if isinstance(v, list)
-                                                else v,
+                                        if v is not None:
+                                            f.write(
+                                                '%s=%s:%s\n' % (
+                                                    k,
+                                                    common.typeName(v),
+                                                    '\n'.join(v)
+                                                    if isinstance(v, list)
+                                                    else v,
+                                                )
                                             )
-                                        )
-                                        wlist.append(k)
+                                            wlist.append(k)
 
             except IOError as e:
                 self.logger.warning(


-- 
To view, visit https://gerrit.ovirt.org/39074
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to