Skip to content

Commit 6ed391f

Browse files
authored
Merge pull request #329 from Helene/config_path_in_service
Make usage of --configFile argument in systemd service
2 parents cd8f7f4 + 0b51846 commit 6ed391f

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

grafana-bridge.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ After=multi-user.target
66
Type=simple
77
Restart=on-failure
88
WorkingDirectory=/opt/IBM/bridge
9-
ExecStart=/usr/bin/python3 -u source/zimonGrafanaIntf.py
9+
ExecStart=/usr/bin/python3 -u source/zimonGrafanaIntf.py --configFile source/config.ini
1010

1111
StandardOutput=journal+console
1212
StandardError=journal+console

source/confParser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def parse_defaults(self):
200200
"""
201201

202202
default_sections, defaults = self.parse_file(self.templateFile)
203-
if not self.customFile:
203+
if not self.customFile or self.customFile == self.templateFile:
204204
return defaults
205205

206206
custom_sections, customs = self.parse_file(self.customFile)

tests/test_configManager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ def test_case03():
4747
@with_setup(my_setup)
4848
def test_case04():
4949
customFile = os.path.join(path, "tests", "test_data", customConfigFile)
50-
print(customFile)
5150
cm = ConfigManager()
5251
cm.customFile = customFile
53-
print(cm.__dict__)
54-
assert (cm.customFile == customFile)
5552
result = cm.readConfigFile(cm.customFile)
5653
assert 'tls' in result.keys()
5754

0 commit comments

Comments
 (0)