Skip to content

Commit

Permalink
commands: add --archive option to ctdb-migrate cmd
Browse files Browse the repository at this point in the history
Passing this argument with a path will archive any of the tdb files that
get migrated to ctdb to the specified path. This moves files from the
typical location to aid in debugging (it's more obvious that this
instance is using ctdb) and for comparison in case something needs to
be compared post-conversion.

Signed-off-by: John Mulligan <[email protected]>
  • Loading branch information
phlogistonjohn authored and mergify[bot] committed Jul 2, 2024
1 parent a123083 commit 59f896e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sambacc/commands/ctdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def _ctdb_migrate_args(parser: argparse.ArgumentParser) -> None:
default=ctdb.DB_DIR,
help="Specify where CTDB database files will be written.",
)
parser.add_argument(
"--archive",
help="Move converted TDB files to an archive dir.",
)


def _ctdb_general_node_args(parser: argparse.ArgumentParser) -> None:
Expand Down Expand Up @@ -250,6 +254,8 @@ def ctdb_migrate(ctx: Context) -> None:
"""Migrate standard samba databases to CTDB databases."""
_ctdb_ok()
ctdb.migrate_tdb(ctx.instance_config, ctx.cli.dest_dir)
if ctx.cli.archive:
ctdb.archive_tdb(ctx.instance_config, ctx.cli.archive)


def _lookup_hostname(hostname):
Expand Down

0 comments on commit 59f896e

Please sign in to comment.