[node-patches] Change in ovirt-node[master]: Fix utils.system.Bootloader().Arguments()
rbarry at redhat.com
rbarry at redhat.com
Fri Jun 27 15:50:49 UTC 2014
Ryan Barry has uploaded a new change for review.
Change subject: Fix utils.system.Bootloader().Arguments()
......................................................................
Fix utils.system.Bootloader().Arguments()
rstrip so we dont' remove leading indentation, and check whether
a newline is present before we add it to grub_cfg. If not, add one
Change-Id: Idc064a456ae8662bf4f8cebd88a19107ca611608
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/system.py
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/60/29360/1
diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index 7b771fc..87bfab4 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -916,14 +916,15 @@
for line in lines:
if re.match(r'.*?\s%s' % arg, line):
if remove:
- line = re.sub(r'%s(=.*?\s?)?' % arg, '', line)
+ line = re.sub(r'%s(=.*?)?(\s|$)' % arg, '', line)
else:
if arg != replacement:
- line = re.sub(r'%s(=.*?\s)?' % arg, ' %s ' %
+ line = re.sub(r'%s(=.*?)?(\s|$)' % arg, ' %s ' %
replacement, line)
elif re.match(r'^.*?vmlinuz', line):
# Not in the kernel line. Add it.
- line = line.strip() + " %s\n" % replacement
+ line = line.rstrip() + " %s\n" % replacement
+ line = line if line.endswith("\n") else "{0}\n".format(line)
grub_cfg += line
File(self.__handle.filename).write(grub_cfg, "w")
self.__mount.remount(rw=False)
--
To view, visit http://gerrit.ovirt.org/29360
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc064a456ae8662bf4f8cebd88a19107ca611608
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>
More information about the node-patches
mailing list