From 5cdc3eb679e9cfa2ed2bde28a1a9c1d6b6c37dbf Mon Sep 17 00:00:00 2001
From: Nico Vermaas <vermaas@astron.nl>
Date: Mon, 8 Aug 2022 12:52:31 +0200
Subject: [PATCH] add ldv_migrate script

---
 README.md                   | 11 +++++++++++
 ldv_migrate/bin/ldv_migrate |  4 ++++
 ldv_migrate/setup.py        | 11 ++++++-----
 3 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 ldv_migrate/bin/ldv_migrate

diff --git a/README.md b/README.md
index d2ea05f..af8566d 100644
--- a/README.md
+++ b/README.md
@@ -79,8 +79,19 @@ old `ldvadmin` database to the new `ldv-spec-db` database.
 ```bash
 # Using pip install (requires valid ssh key, until the repo is set to public)
 pip install pip install -e "git+https://git.astron.nl/ldv/ldv_utils.git#egg=ldvspec-migration&subdirectory=ldv_migrate"
+pip install pip install -e "git+https://git.astron.nl/ldv/ldv_utils.git@SDC-708-add-ldv-migrate-script#egg=ldvspec-migration&subdirectory=ldv_migrate"
+
+```
+
+### Running
+```bash
+ldv_migrate [sas_id] [from status] [to status]
+
+# More info and flags
+ldv_migrate -h
 ```
 
+
 ### Building
 Manual from a checked out repo.
 Look for the 'scripts' directory and run `./build.sh`.
diff --git a/ldv_migrate/bin/ldv_migrate b/ldv_migrate/bin/ldv_migrate
new file mode 100644
index 0000000..329efa4
--- /dev/null
+++ b/ldv_migrate/bin/ldv_migrate
@@ -0,0 +1,4 @@
+#!/usr/bin/env python3
+
+import ldv_migrate
+migrate_ldvadmin_to_ldvspec.main()
\ No newline at end of file
diff --git a/ldv_migrate/setup.py b/ldv_migrate/setup.py
index 1813e2a..30d1f75 100644
--- a/ldv_migrate/setup.py
+++ b/ldv_migrate/setup.py
@@ -13,10 +13,11 @@ setup(name='ldvspec-migration',
       license='Apache 2.0',
       install_requires=get_requirements(),
       packages=find_packages(),
+      py_modules = ['connection', 'ldv_migrate.connection'],
       include_package_data=True,
-      entry_points={
-            'console_scripts': [
-                  'ldv_migrate=ldv_migrate.migrate_ldvadmin_to_ldvspec:main',
-            ],
-      },
+#      entry_points={
+#            'console_scripts': [
+#                  'ldv_migrate=ldv_migrate.migrate_ldvadmin_to_ldvspec:main',
+#            ],
+#      },
       )
\ No newline at end of file
-- 
GitLab