From 13121a1059492dc36a885e443a728b53cfafe3d8 Mon Sep 17 00:00:00 2001 From: Hasan Acar Date: Wed, 6 Mar 2024 08:08:56 +0000 Subject: [PATCH] Making the gates happy fix: allowlist_externals added to tox fix: upgrading gevent fix: pep8 issue fixed for slack_notifier fix: change env list Change-Id: Iefc7fdc89a398623aa3515c89240b53a49c10282 --- docker/Dockerfile | 2 +- monasca_notification/plugins/slack_notifier.py | 3 +-- tox.ini | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0318ea6..7bf787c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,7 +5,7 @@ ARG REPO_VERSION=master ARG CONSTRAINTS_BRANCH=master ARG COMMON_VERSION=master # Extra Python3 dependencies. -ARG EXTRA_DEPS="netaddr gevent==1.3.5 greenlet" +ARG EXTRA_DEPS="netaddr gevent>=21.12.0 greenlet" # Always start from `monasca-base` image and use specific tag of it. ARG BASE_TAG=master FROM monasca/base:$BASE_TAG diff --git a/monasca_notification/plugins/slack_notifier.py b/monasca_notification/plugins/slack_notifier.py index 73beca1..f247353 100644 --- a/monasca_notification/plugins/slack_notifier.py +++ b/monasca_notification/plugins/slack_notifier.py @@ -120,7 +120,7 @@ class SlackNotifier(abstract_notifier.AbstractNotifier): def _send_message(self, request_options): try: url = request_options.get('url') - result = requests.post(**request_options) + result = requests.post(**request_options, timeout=CONF.slack_notifier.timeout) if result.status_code not in range(200, 300): self._log.error('Received an HTTP code {} when trying to post on URL {}.' .format(result.status_code, url)) @@ -176,7 +176,6 @@ class SlackNotifier(abstract_notifier.AbstractNotifier): 'verify': verify, 'params': query_params, 'proxies': proxy_dict, - 'timeout': CONF.slack_notifier.timeout, data_format: slack_message } if self._send_message(request_options): diff --git a/tox.ini b/tox.ini index 828aa26..ea8f3c4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] -envlist = py38,pep8,cover +envlist = py3,pep8,cover minversion = 2.7 skipsdist = True +ignore_basepython_conflict = True [testenv] basepython = python3 @@ -13,7 +14,7 @@ passenv = *_PROXY usedevelop = True install_command = pip install {opts} {packages} -whitelist_externals = bash +allowlist_externals = bash find rm deps =