From 83dbc935d1ac32cbfeca7ba52da6bb4bbb965879 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 19 Sep 2022 15:35:43 +0200 Subject: [PATCH 11/32] migratentp: Catch more specific exception from ntp2chrony Catch OSError instead of Exception from ntp2chrony to avoid pylint errors. --- .../el7toel8/actors/migratentp/libraries/migratentp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/system_upgrade/el7toel8/actors/migratentp/libraries/migratentp.py b/repos/system_upgrade/el7toel8/actors/migratentp/libraries/migratentp.py index a0ad634b..1bc59448 100644 --- a/repos/system_upgrade/el7toel8/actors/migratentp/libraries/migratentp.py +++ b/repos/system_upgrade/el7toel8/actors/migratentp/libraries/migratentp.py @@ -33,7 +33,7 @@ def ntp2chrony(root, ntp_conf, step_tickers): ntp_configuration = ntp2chrony.NtpConfiguration(root, ntp_conf, step_tickers) ntp_configuration.write_chrony_configuration('/etc/chrony.conf', '/etc/chrony.keys', False, True) - except Exception as e: + except OSError as e: raise StopActorExecutionError('ntp2chrony failed: {}'.format(e)) # Return ignored lines from ntp.conf, except 'disable monitor' from -- 2.38.1