From 8069ce54d91918c53ec3bf9f8fd4eee8b6aacb93 Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 28 Aug 2019 15:34:33 +0000 Subject: [PATCH] change imports as a module with osm_lcm prefix change version to be aligned with OSM allow new format for RO version Change-Id: Iacb0eb9c325f3e10158edb7d9c35aa61c7beceed Signed-off-by: tierno --- osm_lcm/ROclient.py | 2 +- osm_lcm/__init__.py | 4 ++-- osm_lcm/lcm.py | 18 ++++++++---------- osm_lcm/netslice.py | 20 ++++++++++++++++---- osm_lcm/vim_sdn.py | 4 ++-- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/osm_lcm/ROclient.py b/osm_lcm/ROclient.py index 058472f..74e9212 100644 --- a/osm_lcm/ROclient.py +++ b/osm_lcm/ROclient.py @@ -617,7 +617,7 @@ class ROClient: for word in str(response_text).split(" "): if "." in word: version_text, _, _ = word.partition("-") - return list(map(int, version_text.split("."))) + return version_text raise ROClientException("Got invalid version text: '{}'".format(response_text), http_code=500) except aiohttp.errors.ClientOSError as e: raise ROClientException(e, http_code=504) diff --git a/osm_lcm/__init__.py b/osm_lcm/__init__.py index 6c890b4..da0d992 100644 --- a/osm_lcm/__init__.py +++ b/osm_lcm/__init__.py @@ -13,5 +13,5 @@ ## # version moved to lcm.py. uncomment if LCM is installed as library and installed -# version = '0.1.12' -# version_date = '2018-08-23' +version = '6.0.2.post0' +version_date = '2018-08-28' diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 57e8173..3b8da7d 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -23,14 +23,12 @@ import logging import logging.handlers import getopt import sys -import ROclient -import ns -import vim_sdn -import netslice + +from osm_lcm import ROclient, ns, vim_sdn, netslice from time import time, sleep -from lcm_utils import versiontuple, LcmException, TaskRegistry, LcmExceptionExit +from osm_lcm.lcm_utils import versiontuple, LcmException, TaskRegistry, LcmExceptionExit +from osm_lcm import version as lcm_version, version_date as lcm_version_date -# from osm_lcm import version as lcm_version, version_date as lcm_version_date, ROclient from osm_common import dbmemory, dbmongo, fslocal, msglocal, msgkafka from osm_common import version as common_version from osm_common.dbbase import DbException @@ -42,12 +40,12 @@ from n2vc import version as n2vc_version __author__ = "Alfonso Tierno" -min_RO_version = [0, 6, 3] +min_RO_version = "0.6.3" min_n2vc_version = "0.0.2" min_common_version = "0.1.19" # uncomment if LCM is installed as library and installed, and get them from __init__.py -lcm_version = '0.1.41' -lcm_version_date = '2019-06-19' +# lcm_version = '0.1.41' +# lcm_version_date = '2019-06-19' health_check_file = path.expanduser("~") + "/time_last_ping" # TODO find better location for this file @@ -186,7 +184,7 @@ class Lcm: try: RO = ROclient.ROClient(self.loop, **self.ro_config) RO_version = await RO.get_version() - if RO_version < min_RO_version: + if versiontuple(RO_version) < versiontuple(min_RO_version): raise LcmException("Not compatible osm/RO version '{}.{}.{}'. Needed '{}.{}.{}' or higher".format( *RO_version, *min_RO_version )) diff --git a/osm_lcm/netslice.py b/osm_lcm/netslice.py index da428d1..839549b 100644 --- a/osm_lcm/netslice.py +++ b/osm_lcm/netslice.py @@ -1,13 +1,25 @@ # -*- coding: utf-8 -*- +## +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +## import asyncio import logging import logging.handlers import traceback -import ns -from ns import populate_dict as populate_dict -import ROclient -from lcm_utils import LcmException, LcmBase +from osm_lcm.ns import populate_dict as populate_dict +from osm_lcm import ROclient, ns +from osm_lcm.lcm_utils import LcmException, LcmBase from osm_common.dbbase import DbException from time import time from copy import deepcopy diff --git a/osm_lcm/vim_sdn.py b/osm_lcm/vim_sdn.py index 1d782a5..7c0bc0b 100644 --- a/osm_lcm/vim_sdn.py +++ b/osm_lcm/vim_sdn.py @@ -18,8 +18,8 @@ import logging import logging.handlers -import ROclient -from lcm_utils import LcmException, LcmBase +from osm_lcm import ROclient +from osm_lcm.lcm_utils import LcmException, LcmBase from osm_common.dbbase import DbException from copy import deepcopy -- 2.25.1