From 04ea10f06ba2f4572c280d234d9652641ee4ec99 Mon Sep 17 00:00:00 2001 From: nicholasyang Date: Thu, 31 Oct 2024 16:02:25 +0800 Subject: [PATCH] Dev: migration: copy migrated corosync.conf to remote nodes (jsc#PED-8252) --- crmsh/migration.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crmsh/migration.py b/crmsh/migration.py index 920f65ad0..6167af965 100644 --- a/crmsh/migration.py +++ b/crmsh/migration.py @@ -83,7 +83,8 @@ def write_in_color(f, color: str, text: str): def migrate(): try: - check() + if 0 != check(list()): + raise MigrationFailure('Unable to start migration.') logger.info('Starting migration...') migrate_corosync_conf() logger.info('Finished migration.') @@ -252,7 +253,12 @@ def migrate_corosync_conf(): corosync_config_format.DomSerializer(config, f) os.fchmod(f.fileno(), 0o644) logger.info('Finish migrating corosync configuration.') - # TODO: copy to all cluster nodes + for host, result in prun.pcopy_to_remote(conf_path, utils.list_cluster_nodes_except_me(), conf_path).items(): + match result: + case None: + pass + case prun.PRunError() as e: + logger.error("Failed to copy crmsh.conf to host %s: %s", host, e) def migrate_corosync_conf_impl(config):