diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-10-26 16:24:46 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-10-26 16:25:12 +0100 |
| commit | 406c948fe78a2a9ff4a26efa78cf172310a88ed6 (patch) | |
| tree | 7c9bf6510d558e99ce8ac2de9684124d49aa607a /src | |
| parent | 9c8bba962298f8e91a12866f3efcb94cf8c8458b (diff) | |
| download | vyos-1x-406c948fe78a2a9ff4a26efa78cf172310a88ed6.tar.gz vyos-1x-406c948fe78a2a9ff4a26efa78cf172310a88ed6.zip | |
pki: T7953: certbot_request() should return None
Diffstat (limited to 'src')
| -rwxr-xr-x | src/conf_mode/pki.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/conf_mode/pki.py b/src/conf_mode/pki.py index 8f1227504..f82e63d93 100755 --- a/src/conf_mode/pki.py +++ b/src/conf_mode/pki.py @@ -125,13 +125,13 @@ def certbot_delete(certificate): if os.path.exists(f'{vyos_certbot_dir}/renewal/{certificate}.conf'): cmd(f'certbot delete --non-interactive --config-dir {vyos_certbot_dir} --cert-name {certificate}') -def certbot_request(name: str, config: dict, dry_run: bool=True): +def certbot_request(name: str, config: dict, dry_run: bool=True) -> None: # We do not call certbot when booting the system - there is no need to do so and # request new certificates during boot/image upgrade as the certbot configuration # is stored persistent under /config - thus we do not open the door to transient # errors if not boot_configuration_complete(): - return + return None domains = '--domains ' + ' --domains '.join(config['domain_name']) tmp = f'certbot certonly --non-interactive --config-dir {vyos_certbot_dir} --cert-name {name} '\ @@ -156,7 +156,8 @@ def certbot_request(name: str, config: dict, dry_run: bool=True): if dry_run: tmp += ' --dry-run' - cmd(tmp, raising=ConfigError, message=f'ACME certbot request failed for "{name}"!') + cmd(tmp, raising=ConfigError, message=f'Certbot request failed for "{name}"!') + return None def get_config(config=None): if config: |
