From 96130222d88f4ce5f436a90fd28bda35f8f8fb07 Mon Sep 17 00:00:00 2001
From: Nico Vermaas <vermaas@astron.nl>
Date: Tue, 9 Aug 2022 13:19:20 +0200
Subject: [PATCH] add missing --token parameter

---
 ldv_migrate/ldv_migrate/ldv_specification_interface.py | 4 ++--
 ldv_migrate/ldv_migrate/migrate_ldvadmin_to_ldvspec.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ldv_migrate/ldv_migrate/ldv_specification_interface.py b/ldv_migrate/ldv_migrate/ldv_specification_interface.py
index d0469ad..ea90c58 100644
--- a/ldv_migrate/ldv_migrate/ldv_specification_interface.py
+++ b/ldv_migrate/ldv_migrate/ldv_specification_interface.py
@@ -19,7 +19,7 @@ import datetime
 from urllib.parse import urlparse, urlunparse
 # ==============================================================
 # The request header
-ATDB_HEADER = {
+REQUEST_HEADER = {
     'content-type': "application/json",
     'cache-control': "no-cache"
 }
@@ -79,7 +79,7 @@ class LDVSpecInterface():
             self.host = LDV_HOST_PROD
         if not self.host.endswith('/'):
             self.host += '/'
-        self.header = ATDB_HEADER
+        self.header = REQUEST_HEADER
         self.header['Authorization'] = f'Token {token}'
         self._session = None
 
diff --git a/ldv_migrate/ldv_migrate/migrate_ldvadmin_to_ldvspec.py b/ldv_migrate/ldv_migrate/migrate_ldvadmin_to_ldvspec.py
index 0086bfd..9cfb88d 100644
--- a/ldv_migrate/ldv_migrate/migrate_ldvadmin_to_ldvspec.py
+++ b/ldv_migrate/ldv_migrate/migrate_ldvadmin_to_ldvspec.py
@@ -70,8 +70,7 @@ def main():
     parser.add_argument("--version", default=False, help="Show current version of this program", action="store_true")
     parser.add_argument("-v", "--verbose", default=False, help="More information at run time.", action="store_true")
     parser.add_argument("-l", "--limit", default=0, type=int, help="Limit on the number of queries (0 is no limit)", action="store")
-    parser.add_argument("-t", "--token", default="ad9b37a24380948601257f9c1f889b07a00ac81e",
-                        help="Token to access the REST API of ldvspec", action="store")
+
     parser.add_argument("--host", nargs="?", default='dev',
                         help="The ldv-spec-db host. Presets are 'dev' (default), 'test', 'prod', otherwise give a full url like https://sdc.astron.nl:5554/ldvspec/api/v1")
     parser.add_argument("--configuration", default='~/shared/ldv_migrate.cfg',
@@ -82,6 +81,7 @@ def main():
     # tested with 10.000 results in 90 seconds so # 11 mil. will be at least 28 hours
     parser.add_argument("-r", "--max_nbr_dps_to_insert_per_request", default=1000, type=int,
                         help="The number of dataproducts to insert per REST request (0 is no limit)", action="store")
+    parser.add_argument("--token", default="ca1a247b2d9ccb556f450e541874e714e6d04eba", help="Token for ldvspec")
 
     args = parser.parse_args()
 
-- 
GitLab