|
22 | 22 | import json |
23 | 23 | import subprocess |
24 | 24 | import urllib.parse |
25 | | - |
26 | | -from django.conf import settings |
| 25 | +from os import environ |
27 | 26 |
|
28 | 27 | from scanpipe.pipelines import Pipeline |
29 | 28 | from scanpipe.pipes import run_command_safely |
30 | 29 |
|
31 | | -GRIMOIRELAB_METRICS_EXECUTABLE = getattr(settings, "GRIMOIRELAB_METRICS_EXECUTABLE", "") |
32 | | -GRIMOIRELAB_OPENSEARCH_INDEX = getattr(settings, "GRIMOIRELAB_OPENSEARCH_INDEX", "") |
33 | | -GRIMOIRELAB_OPENSEARCH_PASSWORD = getattr( |
34 | | - settings, "GRIMOIRELAB_OPENSEARCH_PASSWORD", "" |
35 | | -) |
36 | | -GRIMOIRELAB_OPENSEARCH_URL = getattr(settings, "GRIMOIRELAB_OPENSEARCH_URL", "") |
37 | | -GRIMOIRELAB_OPENSEARCH_USERNAME = getattr( |
38 | | - settings, "GRIMOIRELAB_OPENSEARCH_USERNAME", "" |
39 | | -) |
40 | | -GRIMOIRELAB_PASSWORD = getattr(settings, "GRIMOIRELAB_PASSWORD", "") |
41 | | -GRIMOIRELAB_URL = getattr(settings, "GRIMOIRELAB_URL", "") |
42 | | -GRIMOIRELAB_USERNAME = getattr(settings, "GRIMOIRELAB_USERNAME", "") |
| 30 | +GRIMOIRELAB_METRICS_EXECUTABLE = environ.get("GRIMOIRELAB_METRICS_EXECUTABLE", "") |
| 31 | +GRIMOIRELAB_OPENSEARCH_INDEX = environ.get("GRIMOIRELAB_OPENSEARCH_INDEX", "") |
| 32 | +GRIMOIRELAB_OPENSEARCH_PASSWORD = environ.get("GRIMOIRELAB_OPENSEARCH_PASSWORD", "") |
| 33 | +GRIMOIRELAB_OPENSEARCH_URL = environ.get("GRIMOIRELAB_OPENSEARCH_URL", "") |
| 34 | +GRIMOIRELAB_OPENSEARCH_USERNAME = environ.get("GRIMOIRELAB_OPENSEARCH_USERNAME", "") |
| 35 | +GRIMOIRELAB_PASSWORD = environ.get("GRIMOIRELAB_PASSWORD", "") |
| 36 | +GRIMOIRELAB_URL = environ.get("GRIMOIRELAB_URL", "") |
| 37 | +GRIMOIRELAB_USERNAME = environ.get("GRIMOIRELAB_USERNAME", "") |
43 | 38 |
|
44 | 39 |
|
45 | 40 | class ScanRepoHealth(Pipeline): |
@@ -68,7 +63,7 @@ def get_availability(cls): |
68 | 63 | and GRIMOIRELAB_URL |
69 | 64 | and GRIMOIRELAB_USERNAME |
70 | 65 | ): |
71 | | - return "Grimoirelab is not available." |
| 66 | + return "Grimoirelab is not configured." |
72 | 67 |
|
73 | 68 | def get_repo_url_input(self): |
74 | 69 | """Validate and extract the repository URL from the project's input sources""" |
|
0 commit comments