Skip to content
Snippets Groups Projects
Verified Commit b25e7012 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

resolve various pylint issues

parent fc1801db
No related branches found
No related tags found
1 merge request!18Feature/cleanup
"""
The Provisioning Proxy service, which interacts with LSO running externally.
LSO is responsible for executing Ansible playbooks, that deploy subscriptions.
"""
import json import json
import logging import logging
...@@ -53,7 +57,8 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, ...@@ -53,7 +57,8 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr,
callback_url = f'{settings.load_oss_params().GENERAL.public_hostname}' \ callback_url = f'{settings.load_oss_params().GENERAL.public_hostname}' \
f'/api/processes/{process_id}/resume' f'/api/processes/{process_id}/resume'
logger.debug(f'[provisioning proxy] provisioning for process {process_id}') logger.debug('[provisioning proxy] provisioning for process %s',
process_id)
parameters.update({'callback': callback_url}) parameters.update({'callback': callback_url})
url = f'{pp_params.scheme}://{pp_params.api_base}/api/{endpoint}' url = f'{pp_params.scheme}://{pp_params.api_base}/api/{endpoint}'
...@@ -61,11 +66,11 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, ...@@ -61,11 +66,11 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr,
request = None request = None
if operation == CUDOperation.POST: if operation == CUDOperation.POST:
request = requests.post(url, json=parameters) request = requests.post(url, json=parameters, timeout=10000)
elif operation == CUDOperation.PUT: elif operation == CUDOperation.PUT:
request = requests.put(url, json=parameters) request = requests.put(url, json=parameters, timeout=10000)
elif operation == CUDOperation.DELETE: elif operation == CUDOperation.DELETE:
request = requests.delete(url, json=parameters) request = requests.delete(url, json=parameters, timeout=10000)
if request.status_code != 200: if request.status_code != 200:
print(request.content) print(request.content)
...@@ -136,7 +141,7 @@ def provision_ip_trunk(subscription: IptrunkProvisioning, ...@@ -136,7 +141,7 @@ def provision_ip_trunk(subscription: IptrunkProvisioning,
# 'dry_run': dry_run, # 'dry_run': dry_run,
# 'old_subscription': old_subscription, # 'old_subscription': old_subscription,
# 'subscription': new_subscription # 'subscription': new_subscription
# # FIXME missing parameters # # ... missing parameters
# } # }
# #
# _send_request('ip_trunk', parameters, process_id, CUDOperation.PUT) # _send_request('ip_trunk', parameters, process_id, CUDOperation.PUT)
......
...@@ -90,7 +90,7 @@ def load_oss_params() -> OSSParams: ...@@ -90,7 +90,7 @@ def load_oss_params() -> OSSParams:
look for OSS_PARAMS_FILENAME in the environment and load the parameters look for OSS_PARAMS_FILENAME in the environment and load the parameters
from that file. from that file.
""" """
with open(os.environ['OSS_PARAMS_FILENAME']) as file: with open(os.environ['OSS_PARAMS_FILENAME'], encoding='utf-8') as file:
return OSSParams(**json.loads(file.read())) return OSSParams(**json.loads(file.read()))
......
"""
init class that imports all workflows into GSO.
"""
from orchestrator.workflows import LazyWorkflowInstance from orchestrator.workflows import LazyWorkflowInstance
LazyWorkflowInstance("gso.workflows.device.create_device", "create_device") LazyWorkflowInstance("gso.workflows.device.create_device", "create_device")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment