Skip to content
Snippets Groups Projects
Commit ed73a8c1 authored by Martin Bergemann's avatar Martin Bergemann :speech_balloon:
Browse files

Merge branch 'fixes' into 'master'

Fixes

See merge request !49
parents c89ab221 2ac5fd14
No related branches found
No related tags found
1 merge request!49Fixes
Pipeline #21976 failed
......@@ -10,6 +10,7 @@ lint:
- docker, specific
before_script:
- python3 -m pip install .[test]
- mkdir .mypy_cache
script:
- mypy --install-types --non-interactive
- black --check -t py310 src
......
......@@ -81,7 +81,6 @@
src: "{{ core_dump }}"
dest: /tmp/evaluation_system/evaluation_system.conf
become: "{{'true' if core_ansible_become_user is defined else 'no' }}"
when: core_admin_group is not defined
- name: Deploying evaluation_system
shell:
cmd: $PYTHON3 deploy.py {{ core_install_dir }} -s --arch {{core_arch}} --packages freva
......@@ -122,7 +121,7 @@
chdir: /tmp/evaluation_system
environment:
PYTHON3: "{{ ansible_python_interpreter }}"
EVALUATION_SYSTEM_CONFIG_FILE: "/tmp/evaluation_system/evaluation_system.conf"
EVALUATION_SYSTEM_CONFIG_FILE: "{{ core_root_dir }}/freva/evaluation_system.conf"
PYTHON_VERSION: ""
become: "{{'yes' if core_ansible_become_user is defined else 'no' }}"
- name: Copying Public key file
......
......@@ -109,6 +109,7 @@
shell: /usr/local/bin/docker-or-podman run -d {{docker_cmd}}
- pause: seconds=5
- name: Preparing the root password reset II
become: true
shell: |
/usr/local/bin/docker-or-podman stop {{db_name}}
/usr/local/bin/docker-or-podman rm {{db_name}}
......
......@@ -139,6 +139,11 @@ setup(
include_package_data=True,
data_files=get_data_files(),
license="GPLv3",
project_urls={
"Documentation": "https://freva.gitlab-pages.dkrz.de/deployment/index.html",
"Issues": "https://gitlab.dkrz.de/freva/deployment/-/issues",
"Source": "https://gitlab.dkrz.de/freva/deployment",
},
packages=find_packages("src"),
package_dir={"": "src"},
cmdclass={
......
__version__ = "2208.0.4"
__version__ = "2208.0.7"
AVAILABLE_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
AVAILABLE_CONDA_ARCHS = [
"Linux-x86_64",
......
......@@ -44,7 +44,12 @@ def exec_command(
_ = env.pop("EVALUATION_SYSTEM_CONFIG_FILE", "")
std = stdout or PIPE
res = run(
shlex.split(command), stdout=std, stderr=PIPE, shell=shell, env=env, check=False
shlex.split(command),
stdout=std,
stderr=PIPE,
shell=shell,
env=env,
check=False,
)
try:
res.check_returncode()
......@@ -203,7 +208,10 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
help="The name of the old database",
)
db_parser.add_argument(
"--old-pw", type=str, default=None, help="The passowrd to the old database"
"--old-pw",
type=str,
default=None,
help="The passowrd to the old database",
)
db_parser.add_argument(
"--old-user",
......
......@@ -36,7 +36,10 @@ def parse_args(args: list[str]) -> argparse.Namespace:
default=6111,
)
app.add_argument(
"--wipe", default=False, action="store_true", help="Delete any existing data."
"--wipe",
default=False,
action="store_true",
help="Delete any existing data.",
)
app.add_argument(
"--user",
......
......@@ -339,7 +339,9 @@ class DeployFactory:
return ["web", "core"]
def _set_additional_config_values(
self, step: str, config: dict[str, dict[str, dict[str, str | int | bool]]]
self,
step: str,
config: dict[str, dict[str, dict[str, str | int | bool]]],
) -> None:
"""Set additional values to the configuration."""
if step in self._needs_core:
......@@ -462,7 +464,10 @@ class DeployFactory:
f_obj.write("".join(lines))
def play(
self, server_map: str | None = None, ask_pass: bool = True, verbosity: int = 0
self,
server_map: str | None = None,
ask_pass: bool = True,
verbosity: int = 0,
) -> None:
"""Play the ansible playbook.
......@@ -503,7 +508,10 @@ class DeployFactory:
cmd += " --ask-pass"
try:
_ = run(
shlex.split(cmd), env=os.environ.copy(), cwd=str(asset_dir), check=True
shlex.split(cmd),
env=os.environ.copy(),
cwd=str(asset_dir),
check=True,
)
except KeyboardInterrupt:
pass
......
......@@ -370,7 +370,10 @@ class WebScreen(BaseForm):
npyscreen.TitleText,
name=f"{self.num}Scheduler hostname(s) - comma separated:",
value=",".join(
cast(List[str], cfg.get("scheduler_host", ["levante.dkrz.de"]))
cast(
List[str],
cfg.get("scheduler_host", ["levante.dkrz.de"]),
)
),
),
True,
......@@ -409,7 +412,7 @@ class WebScreen(BaseForm):
name=f"{self.num}Unix group allowed to log on to the web:",
value=cfg.get("allowed_group", "my_freva"),
),
True,
False,
),
ldap_user_base=(
self.add_widget_intelligent(
......@@ -545,7 +548,9 @@ class DBScreen(BaseForm):
cfg = self.get_config(self.step)
db_ports: list[int] = list(range(3300, 3320))
port_idx = get_index(
cast(List[str], list(map(str, db_ports))), str(cfg.get("port", 3306)), 6
cast(List[str], list(map(str, db_ports))),
str(cfg.get("port", 3306)),
6,
)
self.input_fields: dict[str, tuple[npyscreen.TitleText, bool]] = dict(
hosts=(
......
......@@ -97,7 +97,13 @@ def guess_map_server(
host_name, _, port = inp_server.partition(":")
port = port or str(default_port)
return f"{host_name}:{port}"
except (FileNotFoundError, IOError, ValueError, KeyError, json.JSONDecodeError):
except (
FileNotFoundError,
IOError,
ValueError,
KeyError,
json.JSONDecodeError,
):
pass
if mandatory:
raise ValueError(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment