From a01e841ae4c9aa1586e140d68480ca423d410af7 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Sat, 7 Sep 2024 15:49:23 +0200 Subject: [PATCH] Adjust --redeploy vs. missing configuration. Let's help support upgrades on existing systems (without pirogue-admin integration): - Tone down the logging from error to warning. - Exit with rc=0 instead of rc=1. Link: https://github.com/PiRogueToolSuite/pirogue-admin/issues/21 --- pirogue-admin/debian/changelog | 9 +++++++++ pirogue-admin/pirogue_admin/cmd/cli.py | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pirogue-admin/debian/changelog b/pirogue-admin/debian/changelog index a82036d..c52b415 100644 --- a/pirogue-admin/debian/changelog +++ b/pirogue-admin/debian/changelog @@ -1,3 +1,12 @@ +pirogue-admin (1.4.2) UNRELEASED; urgency=medium + + * Adjust --redeploy vs. missing configuration file to help support + upgrades on existing systems (without pirogue-admin integration): + - Tone down the logging from error to warning. + - Exit with rc=0 instead of rc=1. + + -- Cyril Brulebois Sat, 07 Sep 2024 15:47:16 +0200 + pirogue-admin (1.4.1) bookworm; urgency=medium * Extend support for NetworkManager, when the isolated interface is an diff --git a/pirogue-admin/pirogue_admin/cmd/cli.py b/pirogue-admin/pirogue_admin/cmd/cli.py index d295eab..b88af26 100644 --- a/pirogue-admin/pirogue_admin/cmd/cli.py +++ b/pirogue-admin/pirogue_admin/cmd/cli.py @@ -168,8 +168,8 @@ def apply_configuration(c_ctx: ConfigurationContext, in_fd: TextIO, redeploy=Fal if not current_config_path.exists(): # Alternatively, we could go for a noisy no-op, but we should never get # a request to redeploy if there's no configuration in the first place! - logging.error('Cannot redeploy, no configuration file stored!') - sys.exit(1) + logging.warning('Cannot redeploy, no configuration file stored!') + sys.exit(0) in_fd = current_config_path.open('r') # pylint: disable=consider-using-with else: if in_fd is None: