NGPIris 5.2.0.dev1__py3-none-any.whl → 5.2.1.dev1__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 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,13 +67,30 @@ class HCPHandler:
67
67
  self.hcp = credentials_handler.hcp
68
68
  self.endpoint = "https://" + self.hcp["endpoint"]
69
69
 
70
+ gmc_tenant_map = {
71
+ "gmc-joint" : "vgtn0008",
72
+ "gmc-west" : "vgtn0012",
73
+ "gmc-southeast" : "vgtn0014",
74
+ "gmc-south" : "vgtn0015",
75
+ "gmc-orebro" : "vgtn0016",
76
+ "gmc-karolinska" : "vgtn0017",
77
+ "gmc-north" : "vgtn0018",
78
+ "gmc-uppsala" : "vgtn0019"
79
+ }
80
+
70
81
  self.tenant = None
71
82
  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
83
  tenant_parse = parse(endpoint_format_string, self.endpoint)
73
84
  if type(tenant_parse) is Result:
74
- self.tenant = str(tenant_parse[0])
85
+ tenant = str(tenant_parse[0])
86
+ if endpoint_format_string == "https://{}.vgregion.sjunet.org": # Check if endpoint is Sjunet
87
+ self.tenant = gmc_tenant_map[tenant]
88
+ else:
89
+ self.tenant = tenant
90
+
75
91
  break
76
92
 
93
+
77
94
  if not self.tenant:
78
95
  raise RuntimeError("Unable to parse endpoint. Make sure that you have entered the correct endpoint in your credentials JSON file. Hint: The endpoint should *not* contain \"https://\" or port numbers")
79
96
  self.base_request_url = self.endpoint + ":9090/mapi/tenants/" + self.tenant
@@ -403,6 +420,9 @@ class HCPHandler:
403
420
  file_name = Path(local_file_path).name
404
421
  key = file_name
405
422
 
423
+ if "\\" in local_file_path:
424
+ raise RuntimeError("The \"\\\" character is not allowed in the file path")
425
+
406
426
  if self.object_exists(key):
407
427
  raise ObjectAlreadyExist("The object \"" + key + "\" already exist in the mounted bucket")
408
428
  else:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: NGPIris
3
- Version: 5.2.0.dev1
3
+ Version: 5.2.1.dev1
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
@@ -1,21 +1,21 @@
1
1
  NGPIris/__init__.py,sha256=eHaeRGl1JQ_hjsazEd4oQCXOkdpSxLIzg-ipYAAaa-s,69
2
- NGPIris/cli/__init__.py,sha256=w2_abrZPDFZb_iX31nqWJUGsbVmE_zFv1vjQeMsP7BE,13003
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=1GrqqxLT4Z9Vufg4jQoXykJO-UafOhoBYVSgG6mU8Js,25578
9
+ NGPIris/hcp/hcp.py,sha256=eM2wxrX40LADRpWXQhshCk_x_TfmEKOeKSWlIWtvLLg,26296
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.0.dev1.dist-info/LICENSE,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
17
- NGPIris-5.2.0.dev1.dist-info/METADATA,sha256=Wd5zaHozIbbbCxyYrlx8ScOJ_wfvCxElv2_OOe2Xq-4,7080
18
- NGPIris-5.2.0.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
19
- NGPIris-5.2.0.dev1.dist-info/entry_points.txt,sha256=t8ADhe3ovPm9tW3XDZq1_vKmfHY98Ei_o6WioJobNzU,117
20
- NGPIris-5.2.0.dev1.dist-info/top_level.txt,sha256=954WCuIJkle_SMtr7MNPapiiLLAFhlKbcz6Bp89-2V0,8
21
- NGPIris-5.2.0.dev1.dist-info/RECORD,,
16
+ NGPIris-5.2.1.dev1.dist-info/LICENSE,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
17
+ NGPIris-5.2.1.dev1.dist-info/METADATA,sha256=OW6Qciq8p5PqUi-5baMeCpMRcKADr7jYkPt74GVTzBc,7080
18
+ NGPIris-5.2.1.dev1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
+ NGPIris-5.2.1.dev1.dist-info/entry_points.txt,sha256=t8ADhe3ovPm9tW3XDZq1_vKmfHY98Ei_o6WioJobNzU,117
20
+ NGPIris-5.2.1.dev1.dist-info/top_level.txt,sha256=954WCuIJkle_SMtr7MNPapiiLLAFhlKbcz6Bp89-2V0,8
21
+ NGPIris-5.2.1.dev1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5