Skip to content

Commit 59f896e

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
commands: add --archive option to ctdb-migrate cmd
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]>
1 parent a123083 commit 59f896e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sambacc/commands/ctdb.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def _ctdb_migrate_args(parser: argparse.ArgumentParser) -> None:
6262
default=ctdb.DB_DIR,
6363
help="Specify where CTDB database files will be written.",
6464
)
65+
parser.add_argument(
66+
"--archive",
67+
help="Move converted TDB files to an archive dir.",
68+
)
6569

6670

6771
def _ctdb_general_node_args(parser: argparse.ArgumentParser) -> None:
@@ -250,6 +254,8 @@ def ctdb_migrate(ctx: Context) -> None:
250254
"""Migrate standard samba databases to CTDB databases."""
251255
_ctdb_ok()
252256
ctdb.migrate_tdb(ctx.instance_config, ctx.cli.dest_dir)
257+
if ctx.cli.archive:
258+
ctdb.archive_tdb(ctx.instance_config, ctx.cli.archive)
253259

254260

255261
def _lookup_hostname(hostname):

0 commit comments

Comments
 (0)