aboutsummaryrefslogtreecommitdiff
path: root/huge_page_setup_helper.py
diff options
context:
space:
mode:
authorAnton Arapov <anton@redhat.com>2010-10-20 12:49:24 +0200
committerEric B Munson <emunson@mgebm.net>2010-10-20 10:49:31 -0500
commita2c9635bafe8ee55bcaf06a705e1af28b340a081 (patch)
tree9fcbb0f8963bd487f14ee119b5994e20938a6838 /huge_page_setup_helper.py
parent469aaa9be42e8866d7e1527b6f4c5430db4fb38f (diff)
downloadlibhugetlbfs-a2c9635bafe8ee55bcaf06a705e1af28b340a081.tar.gz
setup_helper: make r/w ops of security/limits.d/*.conf more robust.
previous routine led to failures on \n, whitespace, comment in configuration file. Reported-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
Diffstat (limited to 'huge_page_setup_helper.py')
-rwxr-xr-xhuge_page_setup_helper.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py
index 9de0739..c4b3b16 100755
--- a/huge_page_setup_helper.py
+++ b/huge_page_setup_helper.py
@@ -296,8 +296,13 @@ if debug == False:
for line in limitsConfLines:
cfgExist = False
for hugeUser in hugePageUserList:
- if line.split()[0] == hugeUser:
- cfgExist = True
+ try:
+ if line.split()[0] == hugeUser:
+ cfgExist = True
+ except IndexError:
+ # hit either white or comment line, it is safe not to take
+ # any action and continue.
+ pass
if cfgExist == True:
continue
else: