# devops-stages/stage-build.sh
#
-FROM ubuntu:20.04
+FROM ubuntu:22.04
ARG APT_PROXY
RUN if [ ! -z $APT_PROXY ] ; then \
python3 \
python3-all \
python3-dev \
- python3-setuptools
+ python3-setuptools \
+ python3-pip \
+ tox
-RUN python3 -m easy_install pip==21.3.1
-RUN pip install tox==3.24.5
+ENV LC_ALL C.UTF-8
+ENV LANG C.UTF-8
db_uri = EnvironConfig(prefixes=["OSMLCM_", "OSMMON_"]).get("database_uri")
self._store = MotorStore(db_uri)
- self.loading_libjuju = asyncio.Lock(loop=self.loop)
+ self.loading_libjuju = asyncio.Lock()
self.uninstall_locks = {}
self.log.debug("K8S Juju connector initialized")
will_not_delete = False
if model_name not in self.uninstall_locks:
- self.uninstall_locks[model_name] = asyncio.Lock(loop=self.loop)
+ self.uninstall_locks[model_name] = asyncio.Lock()
delete_lock = self.uninstall_locks[model_name]
while delete_lock.locked():
self.loop = loop or asyncio.get_event_loop()
self.loop.set_exception_handler(self.handle_exception)
- self.creating_model = asyncio.Lock(loop=self.loop)
+ self.creating_model = asyncio.Lock()
if self.vca_connection.is_default:
self.health_check_task = self._create_health_check_task()
coroutine_id = ""
if include_coroutine:
try:
- if asyncio.Task.current_task() is not None:
+ if asyncio.current_task() is not None:
def print_cor_name(c):
import inspect
except Exception:
pass
- coro = asyncio.Task.current_task()._coro
+ coro = asyncio.current_task()._coro
coroutine_id = "coro-{} {}()".format(
hex(id(coro))[2:], print_cor_name(coro)
)
db_uri = EnvironConfig(prefixes=["OSMLCM_", "OSMMON_"]).get("database_uri")
self._store = MotorStore(db_uri)
- self.loading_libjuju = asyncio.Lock(loop=self.loop)
+ self.loading_libjuju = asyncio.Lock()
self.delete_namespace_locks = {}
self.log.info("N2VC juju connector initialized")
self.log.info("Deleting namespace={}".format(namespace))
will_not_delete = False
if namespace not in self.delete_namespace_locks:
- self.delete_namespace_locks[namespace] = asyncio.Lock(loop=self.loop)
+ self.delete_namespace_locks[namespace] = asyncio.Lock()
delete_lock = self.delete_namespace_locks[namespace]
while delete_lock.locked():
# limitations under the License.
import abc
-import asyncio
import typing
from motor.motor_asyncio import AsyncIOMotorClient
class MotorStore(Store):
- def __init__(self, uri: str, loop=None):
+ def __init__(self, uri: str):
"""
Constructor
:param: uri: Connection string to connect to the database.
- :param: loop: Asyncio Loop
"""
self._client = AsyncIOMotorClient(uri)
- self.loop = loop or asyncio.get_event_loop()
self._secret_key = None
self._config = EnvironConfig(prefixes=["OSMLCM_", "OSMMON_"])
self.encryption = Encryption(
uri=uri,
config=self._config,
encoding_type="utf-8",
- loop=self.loop,
logger_name="db",
)
# aiokafka
dataclasses==0.6
# via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
+dnspython==2.3.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
+ # pymongo
kafka-python==2.0.2
# via
# -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
# aiokafka
-motor==1.3.1
+motor==3.1.2
# via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
osm-common @ git+https://osm.etsi.org/gerrit/osm/common.git@master
# via -r requirements-dev.in
-packaging==23.0
+packaging==23.1
# via
# -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
# aiokafka
pycryptodome==3.17
# via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
-pymongo==3.13.0
+pymongo==4.3.3
# via
# -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=master
# motor
#######################################################################################
asynctest==0.13.0
# via -r requirements-test.in
-certifi==2022.12.7
+certifi==2023.5.7
# via requests
charset-normalizer==2.1.1
# via
# -r requirements-test.in
# requests
-coverage==7.1.0
+coverage==7.2.5
# via -r requirements-test.in
flake8==4.0.1
# via -r requirements-test.in
# via requests
mccabe==0.6.1
# via flake8
-mock==5.0.1
+mock==5.0.2
# via -r requirements-test.in
-nose2==0.12.0
+nose2==0.13.0
# via -r requirements-test.in
pycodestyle==2.8.0
# via flake8
pyflakes==2.4.0
# via flake8
-requests==2.28.2
+requests==2.30.0
# via requests-mock
requests-mock==1.10.0
# via -r requirements-test.in
six==1.16.0
# via requests-mock
-urllib3==1.26.14
+urllib3==2.0.2
# via requests
charset-normalizer<3 # Required by aiohttp in LCM
juju==3.0.0
kubernetes
-motor==1.3.1
+motor
pyasn1
pyyaml==5.4.1
retrying-async
# via paramiko
cachetools==5.3.0
# via google-auth
-certifi==2022.12.7
+certifi==2023.5.7
# via
# kubernetes
# requests
# via
# -r requirements.in
# requests
-cryptography==39.0.0
+cryptography==40.0.2
# via paramiko
-google-auth==2.16.0
+dnspython==2.3.0
+ # via pymongo
+google-auth==2.17.3
# via kubernetes
idna==3.4
# via requests
# via -r requirements.in
jujubundlelib==0.5.7
# via theblues
-kubernetes==25.3.0
+kubernetes==26.1.0
# via
# -r requirements.in
# juju
# via
# juju
# theblues
-motor==1.3.1
+motor==3.1.2
# via -r requirements.in
-mypy-extensions==0.4.3
+mypy-extensions==1.0.0
# via typing-inspect
oauthlib==3.2.2
# via requests-oauthlib
# via juju
protobuf==3.20.3
# via macaroonbakery
-pyasn1==0.4.8
+pyasn1==0.5.0
# via
# -r requirements.in
# juju
# pyasn1-modules
# rsa
-pyasn1-modules==0.2.8
+pyasn1-modules==0.3.0
# via google-auth
pycparser==2.21
# via cffi
pymacaroons==0.13.0
# via macaroonbakery
-pymongo==3.13.0
+pymongo==4.3.3
# via motor
pynacl==1.5.0
# via
# macaroonbakery
python-dateutil==2.8.2
# via kubernetes
-pytz==2022.7.1
+pytz==2023.3
# via pyrfc3339
pyyaml==5.4.1
# via
# juju
# jujubundlelib
# kubernetes
-requests==2.28.2
+requests==2.30.0
# via
# kubernetes
# macaroonbakery
# python-dateutil
theblues==0.5.2
# via juju
-toposort==1.9
+toposort==1.10
# via juju
-typing-extensions==4.4.0
+typing-extensions==4.5.0
# via typing-inspect
typing-inspect==0.8.0
# via juju
-urllib3==1.26.14
+urllib3==2.0.2
# via
# kubernetes
# requests
-websocket-client==1.5.0
+websocket-client==1.5.1
# via kubernetes
-websockets==7.0
+websockets==11.0.3
# via juju
# The following packages are considered to be unsafe in a requirements file:
[testenv]
usedevelop = True
-basepython = python3.8
+basepython = python3.10
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
deps = -r{toxinidir}/requirements.txt