NGPIris 5.2.0.dev1__py3-none-any.whl → 5.2.1.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- NGPIris/cli/__init__.py +3 -1
- NGPIris/hcp/hcp.py +27 -2
- {NGPIris-5.2.0.dev1.dist-info → NGPIris-5.2.1.dev2.dist-info}/METADATA +3 -3
- {NGPIris-5.2.0.dev1.dist-info → NGPIris-5.2.1.dev2.dist-info}/RECORD +8 -8
- {NGPIris-5.2.0.dev1.dist-info → NGPIris-5.2.1.dev2.dist-info}/WHEEL +1 -1
- {NGPIris-5.2.0.dev1.dist-info → NGPIris-5.2.1.dev2.dist-info}/LICENSE +0 -0
- {NGPIris-5.2.0.dev1.dist-info → NGPIris-5.2.1.dev2.dist-info}/entry_points.txt +0 -0
- {NGPIris-5.2.0.dev1.dist-info → NGPIris-5.2.1.dev2.dist-info}/top_level.txt +0 -0
NGPIris/cli/__init__.py
CHANGED
|
@@ -94,11 +94,13 @@ def upload(context : Context, bucket : str, source : str, destination : str):
|
|
|
94
94
|
"""
|
|
95
95
|
hcph : HCPHandler = get_HCPHandler(context)
|
|
96
96
|
hcph.mount_bucket(bucket)
|
|
97
|
-
source = add_trailing_slash(source)
|
|
98
97
|
destination = add_trailing_slash(destination)
|
|
99
98
|
if Path(source).is_dir():
|
|
99
|
+
source = add_trailing_slash(source)
|
|
100
100
|
hcph.upload_folder(source, destination)
|
|
101
101
|
else:
|
|
102
|
+
file_name = Path(source).name
|
|
103
|
+
destination += file_name
|
|
102
104
|
hcph.upload_file(source, destination)
|
|
103
105
|
|
|
104
106
|
@cli.command()
|
NGPIris/hcp/hcp.py
CHANGED
|
@@ -67,15 +67,37 @@ class HCPHandler:
|
|
|
67
67
|
self.hcp = credentials_handler.hcp
|
|
68
68
|
self.endpoint = "https://" + self.hcp["endpoint"]
|
|
69
69
|
|
|
70
|
+
# A lookup table for GMC names to HCP tenant names
|
|
71
|
+
gmc_tenant_map = {
|
|
72
|
+
"gmc-joint" : "vgtn0008",
|
|
73
|
+
"gmc-west" : "vgtn0012",
|
|
74
|
+
"gmc-southeast" : "vgtn0014",
|
|
75
|
+
"gmc-south" : "vgtn0015",
|
|
76
|
+
"gmc-orebro" : "vgtn0016",
|
|
77
|
+
"gmc-karolinska" : "vgtn0017",
|
|
78
|
+
"gmc-north" : "vgtn0018",
|
|
79
|
+
"gmc-uppsala" : "vgtn0019"
|
|
80
|
+
}
|
|
81
|
+
|
|
70
82
|
self.tenant = None
|
|
71
83
|
for endpoint_format_string in ["https://{}.ngp-fs1000.vgregion.se", "https://{}.ngp-fs2000.vgregion.se", "https://{}.ngp-fs3000.vgregion.se", "https://{}.vgregion.sjunet.org"]:
|
|
72
84
|
tenant_parse = parse(endpoint_format_string, self.endpoint)
|
|
73
85
|
if type(tenant_parse) is Result:
|
|
74
|
-
|
|
86
|
+
tenant = str(tenant_parse[0])
|
|
87
|
+
if endpoint_format_string == "https://{}.vgregion.sjunet.org": # Check if endpoint is Sjunet
|
|
88
|
+
mapped_tenant = gmc_tenant_map.get(tenant)
|
|
89
|
+
if mapped_tenant:
|
|
90
|
+
self.tenant = mapped_tenant
|
|
91
|
+
else:
|
|
92
|
+
raise RuntimeError("The provided tenant name, \"" + tenant + "\", could is not a valid tenant name. Hint: did you spell it correctly?")
|
|
93
|
+
else:
|
|
94
|
+
self.tenant = tenant
|
|
95
|
+
|
|
75
96
|
break
|
|
76
97
|
|
|
98
|
+
|
|
77
99
|
if not self.tenant:
|
|
78
|
-
raise RuntimeError("Unable to parse endpoint. Make sure that you have entered the correct endpoint in your credentials JSON file.
|
|
100
|
+
raise RuntimeError("Unable to parse endpoint, \"" + self.endpoint + "\". Make sure that you have entered the correct endpoint in your credentials JSON file. Hints:\n - The endpoint should *not* contain \"https://\" or port numbers\n - Is the endpoint spelled correctly?")
|
|
79
101
|
self.base_request_url = self.endpoint + ":9090/mapi/tenants/" + self.tenant
|
|
80
102
|
self.aws_access_key_id = self.hcp["aws_access_key_id"]
|
|
81
103
|
self.aws_secret_access_key = self.hcp["aws_secret_access_key"]
|
|
@@ -403,6 +425,9 @@ class HCPHandler:
|
|
|
403
425
|
file_name = Path(local_file_path).name
|
|
404
426
|
key = file_name
|
|
405
427
|
|
|
428
|
+
if "\\" in local_file_path:
|
|
429
|
+
raise RuntimeError("The \"\\\" character is not allowed in the file path")
|
|
430
|
+
|
|
406
431
|
if self.object_exists(key):
|
|
407
432
|
raise ObjectAlreadyExist("The object \"" + key + "\" already exist in the mounted bucket")
|
|
408
433
|
else:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: NGPIris
|
|
3
|
-
Version: 5.2.
|
|
3
|
+
Version: 5.2.1.dev2
|
|
4
4
|
Author-email: Erik Brink <erik.brink@gu.se>, Isak Sylvin <isak.sylvin@gu.se>
|
|
5
5
|
Description-Content-Type: text/markdown
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Dist: requests>=2.31.0
|
|
8
8
|
Requires-Dist: urllib3==1.26.19
|
|
9
|
-
Requires-Dist: boto3
|
|
9
|
+
Requires-Dist: boto3==1.35.81
|
|
10
10
|
Requires-Dist: parse>=1.19.1
|
|
11
11
|
Requires-Dist: RapidFuzz>=3.10.1
|
|
12
12
|
Requires-Dist: tqdm>=4.66.2
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
NGPIris/__init__.py,sha256=eHaeRGl1JQ_hjsazEd4oQCXOkdpSxLIzg-ipYAAaa-s,69
|
|
2
|
-
NGPIris/cli/__init__.py,sha256=
|
|
2
|
+
NGPIris/cli/__init__.py,sha256=9-l5F92SKx060OcnyO1Ko5vKoEpKGgQ95dU_Plt1Hg8,13078
|
|
3
3
|
NGPIris/hci/__init__.py,sha256=qZRzN2JZp8uIw46TQiqJHMIkleiVDErSoZ3-v0O_cZU,38
|
|
4
4
|
NGPIris/hci/exceptions.py,sha256=wUbpUwY8u1QtuSvnzlBuql9LgGsxBl207IGsHkCt-JQ,47
|
|
5
5
|
NGPIris/hci/hci.py,sha256=-7RBWPGqlINVNsl-GbjuXkcLdIF5cs4cu3OFt2FJi1E,4321
|
|
6
6
|
NGPIris/hci/helpers.py,sha256=THZt9ItmEsEiuvB1v99orAx1oOMgBdGR62PQyOre5yo,2592
|
|
7
7
|
NGPIris/hcp/__init__.py,sha256=yMDW3WpxsU89GNcBJ3ApeGHOmWvisfuuAsZxwlKWnpw,38
|
|
8
8
|
NGPIris/hcp/exceptions.py,sha256=24irbs3JMWaVOM_gf4ByR1hfYPpEP1eXPgHvq77uuqU,361
|
|
9
|
-
NGPIris/hcp/hcp.py,sha256=
|
|
9
|
+
NGPIris/hcp/hcp.py,sha256=4_uxfGMNTJvabc_VGTxahrZhIpe5YSIM5Kt14Y8Jx1w,26708
|
|
10
10
|
NGPIris/hcp/helpers.py,sha256=SRHX-B6TSDogK7Mz2co7VkzHtZdtMaMeH-_NoDWEDh8,1406
|
|
11
11
|
NGPIris/hcp/statistics.py,sha256=8VgRC-7hWQOCRWwoKk4NHCtGTdY_4C2iHcAHEXKJ0kM,817
|
|
12
12
|
NGPIris/parse_credentials/__init__.py,sha256=O9uq_F9uOtuW7giW-t10KV4VmTgfkvgaBEwQU43Sf-w,57
|
|
13
13
|
NGPIris/parse_credentials/parse_credentials.py,sha256=E1NzQCMvjOa2mGLBkEYshZomNSxfSCkoc_iUhUfpBEM,2106
|
|
14
14
|
NGPIris/utils/__init__.py,sha256=yPCEc1-_7r01dZ-31EKiA7Jova7ztX7XXuU95IKmKX8,59
|
|
15
15
|
NGPIris/utils/utils.py,sha256=m9qwLuOoiqVNRy7B4raYNFJkigL_wE--PiWhyhVhHII,248
|
|
16
|
-
NGPIris-5.2.
|
|
17
|
-
NGPIris-5.2.
|
|
18
|
-
NGPIris-5.2.
|
|
19
|
-
NGPIris-5.2.
|
|
20
|
-
NGPIris-5.2.
|
|
21
|
-
NGPIris-5.2.
|
|
16
|
+
NGPIris-5.2.1.dev2.dist-info/LICENSE,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
|
|
17
|
+
NGPIris-5.2.1.dev2.dist-info/METADATA,sha256=UTEE5FnL4Sa5MiP4mSA-4NberB64IxFK2beIDOKCA1w,7080
|
|
18
|
+
NGPIris-5.2.1.dev2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
19
|
+
NGPIris-5.2.1.dev2.dist-info/entry_points.txt,sha256=t8ADhe3ovPm9tW3XDZq1_vKmfHY98Ei_o6WioJobNzU,117
|
|
20
|
+
NGPIris-5.2.1.dev2.dist-info/top_level.txt,sha256=954WCuIJkle_SMtr7MNPapiiLLAFhlKbcz6Bp89-2V0,8
|
|
21
|
+
NGPIris-5.2.1.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|