From 4b126f76b616417a90c286ab5a76b9269d7d8cae Mon Sep 17 00:00:00 2001 From: Audrius Mecionis Date: Thu, 14 Jan 2021 14:14:02 +0100 Subject: [PATCH 1/2] cli: remove traling slash from reana server url closes #453 --- reana_client/cli/__init__.py | 3 ++- reana_client/utils.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reana_client/cli/__init__.py b/reana_client/cli/__init__.py index 62ec59d7..2d6c6215 100644 --- a/reana_client/cli/__init__.py +++ b/reana_client/cli/__init__.py @@ -14,6 +14,7 @@ from urllib3 import disable_warnings from reana_client.cli import workflow, files, ping, secrets +from reana_client.utils import get_api_url DEBUG_LOG_FORMAT = ( "[%(asctime)s] p%(process)s " @@ -29,7 +30,7 @@ class Config(object): def __init__(self): """Initialize config variables.""" - self.reana_server_url = os.getenv("REANA_SERVER_URL", None) + self.reana_server_url = get_api_url() class ReanaCLI(click.Group): diff --git a/reana_client/utils.py b/reana_client/utils.py index da50a0e9..fa794f3e 100644 --- a/reana_client/utils.py +++ b/reana_client/utils.py @@ -357,7 +357,8 @@ def parse_secret_from_path(path): def get_api_url(): """Obtain REANA server API URL.""" - return os.environ.get("REANA_SERVER_URL") + server_url = os.getenv("REANA_SERVER_URL", None) + return server_url.strip(" \t\n\r/") if server_url else None def get_reana_yaml_file_path(): From 14b2210a48e48c5c7aa72f97a0252f2f0d4c0e5f Mon Sep 17 00:00:00 2001 From: Audrius Mecionis Date: Fri, 15 Jan 2021 11:11:37 +0100 Subject: [PATCH 2/2] release: 0.7.2 --- CHANGES.rst | 3 ++- reana_client/version.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8727e0a4..d338526b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,12 +1,13 @@ Changes ======= -Version 0.7.2 (UNRELEASED) +Version 0.7.2 (2021-01-15) -------------------------- - Adds support for Python 3.9. - Fixes exception handling when uploading files. - Fixes minor code warnings. +- Fixes traling slash issue from user exported REANA_SERVER_URL. Version 0.7.1 (2020-11-10) -------------------------- diff --git a/reana_client/version.py b/reana_client/version.py index 48121e74..8a5a2bd6 100644 --- a/reana_client/version.py +++ b/reana_client/version.py @@ -14,4 +14,4 @@ from __future__ import absolute_import, print_function -__version__ = "0.7.1" +__version__ = "0.7.2"