From 7b272632a4d9eb8bd96d9eac9eca657ae2e16b07 Mon Sep 17 00:00:00 2001 From: wachsylon <fabian.wachsmann90@gmx.de> Date: Thu, 8 Dec 2022 10:19:17 +0100 Subject: [PATCH] updated toggling --- notebooks/tzis-tutorial.ipynb | 6 ++++-- setup.py | 1 + tzis/swifthandling.py | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/notebooks/tzis-tutorial.ipynb b/notebooks/tzis-tutorial.ipynb index e0c479d..e72f0ec 100644 --- a/notebooks/tzis-tutorial.ipynb +++ b/notebooks/tzis-tutorial.ipynb @@ -793,10 +793,12 @@ "source": [ "## How to make a container public\n", "\n", - "- use the `store`:\n", + "- use tzis:\n", "\n", "```python\n", - "tzis.toggle_public(outstore)\n", + "%env OS_AUTH_TOKEN={token[\"OS_AUTH_TOKEN\"]}\n", + "%env OS_STORAGE_URL={token[\"OS_STORAGE_URL\"]}\n", + "tzis.toggle_public(\"testtzis\")\n", "```\n", "\n", "This will either make the container of the outstore *public* if it was not public or it will make it *private* by removing all access control lists if it was public. Note that only container as a whole can be made public or private.\n", diff --git a/setup.py b/setup.py index 5c14ed1..afc24eb 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ setup( # 'zarr-swiftstore @ git+https://github.com/siligam/zarr-swiftstore.git', 'swiftspec @ git+https://github.com/fsspec/swiftspec', 'python-swiftclient>=3.10.0', + 'pytest', 'lxml'], url='???', author='Fabian Wachsmann, Marco Kulüke', diff --git a/tzis/swifthandling.py b/tzis/swifthandling.py index 725fec9..4765bf3 100644 --- a/tzis/swifthandling.py +++ b/tzis/swifthandling.py @@ -174,8 +174,7 @@ def get_token(swift_base, account, username=None, **kwargs): def toggle_public(container): "toggle container public read_acl settings" getenv = os.environ.get - osurl=getenv('OS_STORAGE_URL') - conn = Connection(preauthurl=osurl, + conn = Connection(preauthurl=getenv('OS_STORAGE_URL'), preauthtoken=getenv('OS_AUTH_TOKEN')) acl = conn.head_container(container).get("x-container-read", "") if ".r:*" in acl: -- GitLab