From f1e2beaef5840746a925bf434fd8386c83ebad0f Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Wed, 20 Mar 2024 10:10:31 +0000 Subject: [PATCH] Install navsyncdb and navpgdump directly Instead of using a "double" shim to install these executable scripts, install their respective modules directly. The existing shim scripts would run the `main()` method as a side-effect of the module being imported, which was a bad idea. With the new script installation method, these commands would essentially run twice on every invocation. --- pyproject.toml | 4 ++-- python/nav/bin/navpgdump.py | 5 ----- python/nav/bin/navsyncdb.py | 4 ---- 3 files changed, 2 insertions(+), 11 deletions(-) delete mode 100755 python/nav/bin/navpgdump.py delete mode 100755 python/nav/bin/navsyncdb.py diff --git a/pyproject.toml b/pyproject.toml index d93bda62c7..3176e86925 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,10 +43,10 @@ navdf = "nav.bin.navdf:main" navdump = "nav.bin.navdump:main" naventity = "nav.bin.naventity:main" navoidverify = "nav.bin.navoidverify:main" -navpgdump = "nav.bin.navpgdump:main" +navpgdump = "nav.pgdump:main" navsnmp = "nav.bin.navsnmp:main" navstats = "nav.bin.navstats:main" -navsyncdb = "nav.bin.navsyncdb:main" +navsyncdb = "nav.pgsync:main" navsynctypes = "nav.bin.navsynctypes:main" navtopology = "nav.bin.navtopology:main" navuser = "nav.bin.navuser:main" diff --git a/python/nav/bin/navpgdump.py b/python/nav/bin/navpgdump.py deleted file mode 100755 index f85ffbf0f8..0000000000 --- a/python/nav/bin/navpgdump.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python -# -*- testargs: --only-open-arp -*- -from nav.pgdump import * - -main() diff --git a/python/nav/bin/navsyncdb.py b/python/nav/bin/navsyncdb.py deleted file mode 100755 index ccb66e4e11..0000000000 --- a/python/nav/bin/navsyncdb.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -from nav.pgsync import main - -main()