DamianZaremba has uploaded a new change for review.
https://gerrit.wikimedia.org/r/55427
Change subject: Better path
......................................................................
Better path
Change-Id: I601d681ca86a5786d2115634538f9805475e3128
---
M labsnagiosbuilder/build.py
1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/nagios-builder
refs/changes/27/55427/1
diff --git a/labsnagiosbuilder/build.py b/labsnagiosbuilder/build.py
index c1bbb75..2c7cd78 100755
--- a/labsnagiosbuilder/build.py
+++ b/labsnagiosbuilder/build.py
@@ -350,9 +350,9 @@
return True
-def load_groups():
+def load_groups(classes_path):
config = ConfigParser.RawConfigParser()
- config.read('classes.ini')
+ config.read(classes_path)
for section in config.sections():
short = config.get(section, 'short')
if not short:
@@ -391,8 +391,10 @@
os.path.abspath(__file__))))
# Load the group info
- if os.path.isfile('classes.ini'):
- load_groups()
+ classes_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ 'classes.ini')
+ if os.path.isfile(classes_path):
+ load_groups(classes_path)
# Connect
ldap_connection = ldap_connect()
--
To view, visit https://gerrit.wikimedia.org/r/55427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I601d681ca86a5786d2115634538f9805475e3128
Gerrit-PatchSet: 1
Gerrit-Project: labs/nagios-builder
Gerrit-Branch: master
Gerrit-Owner: DamianZaremba <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits