Check if the HOME env var is set, otherwise use a default
This patch adds code to check if the env var HOME is set, otherwise uses a default value Change-Id: I8b1de9f41ba77c8026321bc9e67a951db32745f4
This commit is contained in:
@@ -20,8 +20,11 @@ import yaml
|
||||
from observabilityclient.prometheus_client import PrometheusAPIClient
|
||||
|
||||
|
||||
DEFAULT_CONFIG_LOCATIONS = [os.environ["HOME"] + "/.config/openstack/",
|
||||
"/etc/openstack/"]
|
||||
DEFAULT_CONFIG_LOCATIONS = (
|
||||
[os.path.join(os.environ["HOME"], ".config/openstack/"), "/etc/openstack/"]
|
||||
if "HOME" in os.environ
|
||||
else ["/etc/openstack/"]
|
||||
)
|
||||
CONFIG_FILE_NAME = "prometheus.yaml"
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
Reference in New Issue
Block a user