X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fservice%2Fauditor%2Focloud_handler.py;fp=o2ims%2Fservice%2Fauditor%2Focloud_handler.py;h=c0d8eaf700b10e4b1cc667eb4b3a6f8568a78a80;hb=44f01a560347914798d8f913696d0e495ee076f8;hp=c8c1e1b7862bf39a0e5e3848dae877065fd2fe6b;hpb=5ad82f634e2f10aaeccf1d2420fafc63e2d0056e;p=pti%2Fo2.git diff --git a/o2ims/service/auditor/ocloud_handler.py b/o2ims/service/auditor/ocloud_handler.py index c8c1e1b..c0d8eaf 100644 --- a/o2ims/service/auditor/ocloud_handler.py +++ b/o2ims/service/auditor/ocloud_handler.py @@ -43,9 +43,9 @@ def update_ocloud( stxobj = cmd.data with uow: oclouds = uow.oclouds.list() - if oclouds and len(oclouds) > 1: + if oclouds and oclouds.count() > 1: raise InvalidOcloudState("More than 1 ocloud is found") - elif not oclouds or len(oclouds) == 0: + elif not oclouds or oclouds.count() == 0: logger.info("add ocloud:" + stxobj.name + " update_at: " + str(stxobj.updatetime) + " id: " + str(stxobj.id) @@ -56,7 +56,7 @@ def update_ocloud( logger.info("Add the ocloud: " + stxobj.id + ", name: " + stxobj.name) else: - localmodel = oclouds.pop() + localmodel = oclouds.first() if is_outdated(localmodel, stxobj): logger.info("update ocloud:" + stxobj.name + " update_at: " + str(stxobj.updatetime)