[node-patches] Change in ovirt-node[master]: network: use strip() to compare strings

fabiand at redhat.com fabiand at redhat.com
Fri Jul 17 07:01:56 UTC 2015


Fabian Deutsch has posted comments on this change.

Change subject: network: use strip() to compare strings
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/43755/1/src/ovirt/node/config/network.py
File src/ovirt/node/config/network.py:

Line 235:         utils.process.check_call(["hostnamectl", "set-hostname",
Line 236:                                   new_hostname])
Line 237: 
Line 238:     current_hostname = utils.fs.get_contents(hostnamefile)
Line 239:     if new_hostname and current_hostname.strip() != new_hostname.strip():
Here the point is fixed where the problem appears.

It would be better if we fixed the bug by fixing the source of the problem. So the functions which determin both of those values.

I.e. current_hostname should probably be fixed in line 238.
And for new_hostname we should identifiy where it get's assigned.
Line 240:         raise RuntimeError(("Runtime hostname '%s' doesn't match" +
Line 241:                             "configured one: %s") % (current_hostname,
Line 242:                                                      new_hostname))
Line 243: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7522def9aafb18be7dfc7b13c35f0ed0b45583a8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Anatoly Litovsky <tlitovsk at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes



More information about the node-patches mailing list