Skip to content

Commit 4e9f2c2

Browse files
author
Marc Schöchlin
committed
config improvements
- set no password as default (enforces to choose one) - provide the possibility to configure a default search path Signed-off-by: Marc Schöchlin <[email protected]>
1 parent 26e5880 commit 4e9f2c2

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/openstack_workload_generator/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
type=str,
7171
default="default.yaml",
7272
help="The config file for environment creation, define a path to the"
73-
" yaml file or a subpath in the profiles folder",
73+
" yaml file or a subpath in the profiles folder of the tool "
74+
"(you can overload the search path by setting the OPENSTACK_WORKLOAD_MANAGER_PROFILES environment variable)"
7475
)
7576

7677
exclusive_group_domain = parser.add_mutually_exclusive_group(required=True)

src/openstack_workload_generator/entities/helpers.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import sys
55
from datetime import datetime
6+
from pathlib import Path
67
from typing import Tuple, Any
78
import coloredlogs
89

@@ -16,8 +17,8 @@
1617

1718
class Config:
1819
_config: dict[str, str | dict[str, str] | None] = {
19-
"admin_domain_password": "yolobanana",
20-
"admin_vm_password": "yolobanana",
20+
"admin_domain_password": "",
21+
"admin_vm_password": "",
2122
"admin_vm_ssh_key": "",
2223
"admin_vm_ssh_keypair_name": "my_ssh_public_key",
2324
"project_ipv4_subnet": "192.168.200.0/24",
@@ -66,6 +67,11 @@ def load_config(config_file: str):
6667
+ f"/../../../profiles/{config_file}"
6768
)
6869

70+
if os.getenv("OPENSTACK_WORKLOAD_MANAGER_PROFILES",None):
71+
potential_profile_file = str(Path(os.getenv("OPENSTACK_WORKLOAD_MANAGER_PROFILES")) / Path(config_file))
72+
LOGGER.info("Environment variable OPENSTACK_WORKLOAD_MANAGER_PROFILES set,"
73+
f" searching for potential {potential_profile_file}")
74+
6975
if os.path.exists(config_file):
7076
Config._file = config_file
7177
elif not str(config_file).startswith("/") and os.path.exists(

0 commit comments

Comments
 (0)