Skip to content

Commit 04ea10f

Browse files
Dev: migration: copy migrated corosync.conf to remote nodes (jsc#PED-8252)
1 parent 06d836a commit 04ea10f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

crmsh/migration.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def write_in_color(f, color: str, text: str):
8383

8484
def migrate():
8585
try:
86-
check()
86+
if 0 != check(list()):
87+
raise MigrationFailure('Unable to start migration.')
8788
logger.info('Starting migration...')
8889
migrate_corosync_conf()
8990
logger.info('Finished migration.')
@@ -252,7 +253,12 @@ def migrate_corosync_conf():
252253
corosync_config_format.DomSerializer(config, f)
253254
os.fchmod(f.fileno(), 0o644)
254255
logger.info('Finish migrating corosync configuration.')
255-
# TODO: copy to all cluster nodes
256+
for host, result in prun.pcopy_to_remote(conf_path, utils.list_cluster_nodes_except_me(), conf_path).items():
257+
match result:
258+
case None:
259+
pass
260+
case prun.PRunError() as e:
261+
logger.error("Failed to copy crmsh.conf to host %s: %s", host, e)
256262

257263

258264
def migrate_corosync_conf_impl(config):

0 commit comments

Comments
 (0)