Alon Bar-Lev has posted comments on this change.

Change subject: packaging: setup: support classless IN-ADDR.ARPA delegation
......................................................................


Patch Set 1:

(3 comments)

Thank you for the patch!

Few comments in-line.

Can you please paste an example of dig output to show the input of this 
algorithm?

http://gerrit.ovirt.org/#/c/23818/1/packaging/setup/plugins/ovirt-engine-setup/base/network/hostname.py
File packaging/setup/plugins/ovirt-engine-setup/base/network/hostname.py:

Line 171:         rc, stdout, stderr = self.execute(
Line 172:             args=args,
Line 173:             raiseOnError=False
Line 174:         )
Line 175:         ad=addr.split('.')
please make sure that you pass pyflakes, pep8.
Line 176:         query="{3}.{2}.{1}.{0}.in-addr.arpa".format(*ad)
Line 177:         if rc == 0:
Line 178:             for line in stdout:
Line 179:                 found = self._DIG_REVLOOKUP_RE.search(line)


Line 172:             args=args,
Line 173:             raiseOnError=False
Line 174:         )
Line 175:         ad=addr.split('.')
Line 176:         query="{3}.{2}.{1}.{0}.in-addr.arpa".format(*ad)
please avoid temp variables, can be:

 query = ... .format(addr.split('.))

however, I think that it can be simply as:

 query = '%s.in-addr.arpa' % '.'.join(reversed(addr.split('.')))
Line 177:         if rc == 0:
Line 178:             for line in stdout:
Line 179:                 found = self._DIG_REVLOOKUP_RE.search(line)
Line 180:                 if not found:


Line 189:                             answer=answer,
Line 190:                         )
Line 191:                     )
Line 192:                     query=answer
Line 193:                     continue
please do not use continue and modify state, best is just eliminate the 
continue in this case, and handle procedural logic later.
Line 194:                 self.logger.debug(
Line 195:                     '{query} resolves to: {answer}'.format(
Line 196:                         query=query,
Line 197:                         answer=answer,


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f65fbc27992ddae0b3d01e19d317a2abe39db7b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mark Kachi <love.ca...@gmail.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to