diff options
author | michal.jagiello@t-mobile.pl <michal.jagiello@t-mobile.pl> | 2024-03-12 16:46:54 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2024-03-14 09:31:10 +0100 |
commit | bd1eed0a99651140fe381c183bc38221c598814f (patch) | |
tree | d71514457dc85d733c10536724cab7690af645c5 /src | |
parent | 7c3de7ac0ff93bae27f2a0a30198bb3d2e24cbf1 (diff) |
Version 13.0.5 -- Add an exception on SDC model distribution check
There is a chance that SO-SDC controller returns an
error that some artifact is not used in model. That's
not an error which should mark distribution as failed
Issue-ID: TEST-404
Change-Id: I27011f5c8989f989b95fa06a4632bf0ef16cc9bf
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Diffstat (limited to 'src')
-rw-r--r-- | src/onapsdk/sdc2/service.py | 12 | ||||
-rw-r--r-- | src/onapsdk/version.py | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/onapsdk/sdc2/service.py b/src/onapsdk/sdc2/service.py index 5f3a71c..1ec64b5 100644 --- a/src/onapsdk/sdc2/service.py +++ b/src/onapsdk/sdc2/service.py @@ -25,6 +25,10 @@ from onapsdk.sdc2.sdc_user import SdcUser from onapsdk.utils.jinja import jinja_env # type: ignore +ARTIFACT_NOT_USED_ERROR_REASON = \ + "The artifact has not been used by the modules defined in the resource" + + class ServiceInstantiationType(Enum): """Service instantiation type enum class. @@ -55,18 +59,20 @@ class ServiceDistribution(SDC): @property def failed(self) -> bool: - """Flad to determine if distribution status is failed or not. + """Flag to determine if distribution status is failed or not. If error reason of distribution status is not empty it doesn't mean always that distribution failed at all. On some cases that means that service was already distributed on that component. That's why - we checks also if status is not "ALREADY_DEPLOYED". + we checks also if status is not "ALREADY_DEPLOYED". On SO there is also + an error "The artifact has not been used..." which also shouldn't + be treated as an error. Returns: bool: True if distribution on component failed or not. """ - return self.error_reason != "null" and \ + return self.error_reason not in ["null", ARTIFACT_NOT_USED_ERROR_REASON] and \ self.status != "ALREADY_DEPLOYED" def __init__(self, # pylint: disable=too-many-arguments diff --git a/src/onapsdk/version.py b/src/onapsdk/version.py index 6d6d217..d606f96 100644 --- a/src/onapsdk/version.py +++ b/src/onapsdk/version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "13.0.4" +__version__ = "13.0.5" |