Skip to content

Commit 51ab9ca

Browse files
committed
migrate_to_persist_sqlite.py: Fix db dump tool name
Closes eclipse-mosquitto#3473. Thanks to Stuart Henderson
1 parent 87903e2 commit 51ab9ca

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

plugins/persist-sqlite/migrate_to_persist_sqlite.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,22 +295,22 @@ def migrate_to_persist_sqlite(
295295
# Migration
296296

297297

298-
def find_mosquitto_dump_tool() -> str:
299-
mosquitto_dump_tool = shutil.which("mosquitto_dump_tool")
300-
if mosquitto_dump_tool is None:
298+
def find_mosquitto_db_dump() -> str:
299+
mosquitto_db_dump = shutil.which("mosquitto_db_dump")
300+
if mosquitto_db_dump is None:
301301
raise RuntimeError(
302-
'Could not find mosquitto_dump_tool. Provide the path via the "--dump-tool" argument '
302+
'Could not find mosquitto_db_dump. Provide the path via the "--dump-tool" argument '
303303
"or make sure the executable is contained in your system's path."
304304
)
305-
return mosquitto_dump_tool
305+
return mosquitto_db_dump
306306

307307

308308
def dump_mosquitto_db_to_json(
309-
mosquitto_dump_tool: str, persistence_db_path: Path
309+
mosquitto_db_dump: str, persistence_db_path: Path
310310
) -> str:
311311
return subprocess.check_output(
312312
[
313-
mosquitto_dump_tool,
313+
mosquitto_db_dump,
314314
"--json",
315315
str(persistence_db_path),
316316
]
@@ -351,8 +351,8 @@ def main():
351351

352352
args = parser.parse_args()
353353
persistence_db_path = Path(args.persistence_db)
354-
mosquitto_dump_tool = (
355-
args.dump_tool if args.dump_tool else find_mosquitto_dump_tool()
354+
mosquitto_db_dump = (
355+
args.dump_tool if args.dump_tool else find_mosquitto_db_dump()
356356
)
357357

358358
if args.conf is not None:
@@ -377,7 +377,7 @@ def main():
377377

378378
# Dump Snapshot persistence and parse JSON
379379
snapshot_persistence = SnapshotPersistence(
380-
dump_mosquitto_db_to_json(mosquitto_dump_tool, persistence_db_path)
380+
dump_mosquitto_db_to_json(mosquitto_db_dump, persistence_db_path)
381381
)
382382

383383
# Migrate Snapshot persistence and write SQLite3 file

0 commit comments

Comments
 (0)