X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Flcm_utils.py;h=2c84356eb16e687f54e654886ec6679217e52c70;hb=c2033f23c8111a172f70873beda52735e23f41a6;hp=1ea370b70a83881d6b550489a9d1ca35c14866b5;hpb=59d22d2291db050aa17573d994f5274f67ae1212;p=osm%2FLCM.git diff --git a/osm_lcm/lcm_utils.py b/osm_lcm/lcm_utils.py index 1ea370b..2c84356 100644 --- a/osm_lcm/lcm_utils.py +++ b/osm_lcm/lcm_utils.py @@ -12,11 +12,18 @@ class LcmException(Exception): pass +class LcmExceptionNoMgmtIP(LcmException): + pass + + def versiontuple(v): - """utility for compare dot separate versions. Fills with zeros to proper number comparison""" + """utility for compare dot separate versions. Fills with zeros to proper number comparison + package version will be something like 4.0.1.post11+gb3f024d.dirty-1. Where 4.0.1 is the git tag, postXX is the + number of commits from this tag, and +XXXXXXX is the git commit short id. Total length is 16 with until 999 commits + """ filled = [] for point in v.split("."): - filled.append(point.zfill(8)) + filled.append(point.zfill(16)) return tuple(filled) @@ -33,6 +40,7 @@ class TaskRegistry: def __init__(self): self.task_registry = { "ns": {}, + "nsi": {}, "vim_account": {}, "sdn": {}, } @@ -40,7 +48,7 @@ class TaskRegistry: def register(self, topic, _id, op_id, task_name, task): """ Register a new task - :param topic: Can be "ns", "vim_account", "sdn" + :param topic: Can be "ns", "nsi", "vim_account", "sdn" :param _id: _id of the related item :param op_id: id of the operation of the related item :param task_name: Task descriptive name, as create, instantiate, terminate. Must be unique in this op_id @@ -58,7 +66,7 @@ class TaskRegistry: def remove(self, topic, _id, op_id, task_name=None): """ When task is ended, it should removed. It ignores missing tasks - :param topic: Can be "ns", "vim_account", "sdn" + :param topic: Can be "ns", "nsi", "vim_account", "sdn" :param _id: _id of the related item :param op_id: id of the operation of the related item :param task_name: Task descriptive name. If note it deletes all @@ -96,8 +104,8 @@ class TaskRegistry: def cancel(self, topic, _id, target_op_id=None, target_task_name=None): """ - Cancel all active tasks of a concrete ns, vim_account, sdn identified for _id. If op_id is supplied only this is - cancelled, and the same with task_name + Cancel all active tasks of a concrete ns, nsi, vim_account, sdn identified for _id. If op_id is supplied only + this is cancelled, and the same with task_name """ if not self.task_registry[topic].get(_id): return