Skip to content

Commit

Permalink
Dev: migration: copy migrated corosync.conf to remote nodes (jsc#PED-…
Browse files Browse the repository at this point in the history
…8252)
  • Loading branch information
nicholasyang2022 committed Oct 31, 2024
1 parent de4b684 commit 45d2310
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crmsh/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down Expand Up @@ -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)

Check warning on line 261 in crmsh/migration.py

View check run for this annotation

Codecov / codecov/patch

crmsh/migration.py#L246-L261

Added lines #L246 - L261 were not covered by tests


def migrate_corosync_conf_impl(config):
Expand Down

0 comments on commit 45d2310

Please sign in to comment.