Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: move the creation of open api clients to reana-commons #115

Merged
merged 2 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions reana_server/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@
# under the terms of the MIT License; see LICENSE file for more details.

"""REST API client generator."""
from functools import partial

import json
import os

import pkg_resources
from flask import current_app
from reana_commons.api_client import BaseAPIClient
from reana_commons.api_client import get_current_api_client
from werkzeug.local import LocalProxy


def _get_current_rwc_api_client():
"""Return current state of the search extension."""
rwc_api_client = BaseAPIClient('reana-workflow-controller')
return rwc_api_client._client


current_rwc_api_client = LocalProxy(_get_current_rwc_api_client)
current_rwc_api_client = LocalProxy(
partial(get_current_api_client, component='reana-workflow-controller'))
6 changes: 3 additions & 3 deletions reana_server/rest/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import traceback

from bravado.exception import HTTPError
from flask import Blueprint
from flask import current_app as app
from flask import Blueprint, jsonify, request, send_file
from flask import jsonify, request, send_file

from reana_server.api_client import current_rwc_api_client
from reana_server.utils import get_user_from_token, is_uuid_v4

from ..api_client import current_rwc_api_client

blueprint = Blueprint('workflows', __name__)


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'flask-cors>=3.0.6',
'marshmallow>=2.13',
'pyOpenSSL==17.5.0', # FIXME remove once yadage-schemas solves deps.
'reana-commons>=0.5.0.dev20181204,<0.6.0',
'reana-commons>=0.5.0.dev20181210,<0.6.0',
'reana-db>=0.5.0.dev20181126,<0.6.0',
'requests==2.20.0',
'rfc3987==1.3.7', # FIXME remove once yadage-schemas solves deps.
Expand Down