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

dougsland at redhat.com dougsland at redhat.com
Thu Jul 16 21:40:15 UTC 2015


Douglas Schilling Landgraf has uploaded a new change for review.

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

network: use strip() to compare strings

To avoid unexpected chars like \n this patch adds
strip() into the variables.

Change-Id: I7522def9aafb18be7dfc7b13c35f0ed0b45583a8
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M src/ovirt/node/config/network.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/55/43755/1

diff --git a/src/ovirt/node/config/network.py b/src/ovirt/node/config/network.py
index b5cbc61..bfc19e5 100644
--- a/src/ovirt/node/config/network.py
+++ b/src/ovirt/node/config/network.py
@@ -236,7 +236,7 @@
                                   new_hostname])
 
     current_hostname = utils.fs.get_contents(hostnamefile)
-    if new_hostname and current_hostname != new_hostname:
+    if new_hostname and current_hostname.strip() != new_hostname.strip():
         raise RuntimeError(("Runtime hostname '%s' doesn't match" +
                             "configured one: %s") % (current_hostname,
                                                      new_hostname))


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7522def9aafb18be7dfc7b13c35f0ed0b45583a8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>



More information about the node-patches mailing list