Yaniv Bronhaim has posted comments on this change.

Change subject: Fix configfile to use unicode which allows to add toolTests to 
python3 check
......................................................................


Patch Set 14:

(3 comments)

https://gerrit.ovirt.org/#/c/48052/14/automation/check-patch.packages.fc23
File automation/check-patch.packages.fc23:

PS14, Line 5: python3
> Why this dependency is needed?
because once importing configurator.py we also import all configurators 
modules. one of them is sebool.py which requires that


https://gerrit.ovirt.org/#/c/48052/14/lib/vdsm/tool/configfile.py
File lib/vdsm/tool/configfile.py:

Line 114:     def _getOldContent(self):
Line 115:         confpat = re.compile(r'^\s*(?P<key>[^=\s#]*)\s*=')
Line 116:         oldlines = []
Line 117:         oldentries = set()
Line 118:         with io.open(self._filename, 'r', encoding='utf8') as f:
> Do we have unicode keys and values?
we might have unicode values... i don't know. why to limit?
Line 119:             for line in f:
Line 120:                 if self._remove:
Line 121:                     if (self._rmstate == BEFORE and
Line 122:                             line.startswith(self._sectionStart)):


Line 143:                         oldlines.append(line)
Line 144:             return oldlines, oldentries
Line 145: 
Line 146:     def _start(self):
Line 147:         return u"%s-%s\n" % (self._sectionStart, self._version)
> If working with bytes, use b"%s-%s" % (...)
I prefer to use unicode for configuration file
Line 148: 
Line 149:     def _end(self):
Line 150:         return u"%s-%s\n" % (self._sectionEnd, self._version)
Line 151: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I52f11a1a10cae46773d05d0c09da80ad8eb3b772
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykap...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-Reviewer: mooli tayer <mta...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to