Module: check_mk
Branch: master
Commit: 5c911eb59415dfb0d7e2a5f788ce95db80a24641
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5c911eb59415df…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 26 08:38:51 2018 +0200
Fixed access to undefined variables - Thanks pylint
Change-Id: Ib6ec0779ee8dcf90715ebb41935fcd735d0b1d13
---
omd/packages/omd/index.py | 2 +-
omd/packages/omd/omd | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/omd/packages/omd/index.py b/omd/packages/omd/index.py
index d25d22c..a14848e 100644
--- a/omd/packages/omd/index.py
+++ b/omd/packages/omd/index.py
@@ -1,4 +1,4 @@
-from mod_python import apache,util
+from mod_python import apache,util # pylint: disable=import-error
import os, re
def site_name(req):
diff --git a/omd/packages/omd/omd b/omd/packages/omd/omd
index 4f4f910..cdb8f2e 100644
--- a/omd/packages/omd/omd
+++ b/omd/packages/omd/omd
@@ -665,13 +665,12 @@ def read_skel_permissions():
global g_skel_permissions
g_skel_permissions = load_skel_permissions(OMD_VERSION)
if not g_skel_permissions:
- bail_out("%s is missing or currupted." % file_path)
+ bail_out("%s is missing or currupted." %
skel_permissions_file_path(OMD_VERSION))
def load_skel_permissions(version):
perms = {}
- file_path = "/omd/versions/%s/share/omd/skel.permissions" % version
try:
- for line in file(file_path):
+ for line in file(skel_permissions_file_path(version)):
line = line.strip()
if line == "" or line[0] == "#":
continue
@@ -682,6 +681,9 @@ def load_skel_permissions(version):
except:
return None
+def skel_permissions_file_path(version):
+ return "/omd/versions/%s/share/omd/skel.permissions" % version
+
def get_skel_permissions(version, perms, relpath):
try:
return perms[relpath]
@@ -3036,7 +3038,7 @@ def diff_list(from_skelroot, g_sitedir, from_version, orig_path):
if abs_path == ".":
abs_path = ""
elif abs_path.startswith("./"):
- abs_path = path[2:]
+ abs_path = abs_path[2:]
abs_path = os.getcwd() + "/" + abs_path
abs_path = abs_path.rstrip("/")