summaryrefslogtreecommitdiffstats
path: root/app/discover
diff options
context:
space:
mode:
authoryayogev <yaronyogev@gmail.com>2017-09-06 20:06:19 +0300
committeryayogev <yaronyogev@gmail.com>2017-09-06 20:06:19 +0300
commitf666cfba54d300366822de2046766776c3e7771f (patch)
tree65753e70ff217349acad27e2d75d4f566c3056c6 /app/discover
parent23272dbefa45c07f9a4cf5a870334f4173711021 (diff)
allow debug with different app path for Sensu handler
Change-Id: I097973a35bc2297d612f93a43d0285b8223b7091 Signed-off-by: yayogev <yaronyogev@gmail.com>
Diffstat (limited to 'app/discover')
-rw-r--r--app/discover/scanner.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/discover/scanner.py b/app/discover/scanner.py
index 3a0b2a5..d1323bd 100644
--- a/app/discover/scanner.py
+++ b/app/discover/scanner.py
@@ -235,10 +235,16 @@ class Scanner(Fetcher):
if not ret:
self.found_errors[self.get_env()] = True
+ def get_run_app_path(self):
+ conf = self.config.get_env_config()
+ run_app_path = conf.get('run_app_path', '')
+ if not run_app_path:
+ run_app_path = conf.get('app_path', '/etc/calipso')
+ return run_app_path
+
def load_scanners_metadata(self):
parser = ScanMetadataParser(self.inv)
- conf = self.config.get_env_config()
- scanners_file = os.path.join(conf.get('app_path', '/etc/calipso'),
+ scanners_file = os.path.join(self.get_run_app_path(),
'config',
ScanMetadataParser.SCANNERS_FILE)
@@ -249,7 +255,7 @@ class Scanner(Fetcher):
def load_link_finders_metadata(self):
parser = FindLinksMetadataParser()
conf = self.config.get_env_config()
- finders_file = os.path.join(conf.get('app_path', '/etc/calipso'),
+ finders_file = os.path.join(self.get_run_app_path(),
'config',
FindLinksMetadataParser.FINDERS_FILE)
metadata = parser.parse_metadata_file(finders_file)