X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Futils.py;h=e8cf64dac123207f6023ca18ac035ebe9f1840e0;hp=62892eb09b6004afe305fb4f893b1fba11915b44;hb=c38a696d168531e3c067451044262ef4d78ef11f;hpb=ba6e532cda6464759381585452b18f9fd1a19dd3 diff --git a/n2vc/utils.py b/n2vc/utils.py index 62892eb..e8cf64d 100644 --- a/n2vc/utils.py +++ b/n2vc/utils.py @@ -67,36 +67,24 @@ class EntityType(Enum): return cls.get_entity(v) -FinalStatus = Dict( - { - EntityType.MACHINE: Dict({"field": "agent_status", "status": ["started"]}), - EntityType.APPLICATION: Dict( - {"field": "status", "status": ["active", "blocked"]} - ), - EntityType.ACTION: Dict( - {"field": "status", "status": ["completed", "failed", "cancelled"]} - ), - } -) - JujuStatusToOSM = { - EntityType.MACHINE: { + "machine": { "pending": N2VCDeploymentStatus.PENDING, "started": N2VCDeploymentStatus.COMPLETED, }, - EntityType.APPLICATION: { + "application": { "waiting": N2VCDeploymentStatus.RUNNING, "maintenance": N2VCDeploymentStatus.RUNNING, "blocked": N2VCDeploymentStatus.RUNNING, "error": N2VCDeploymentStatus.FAILED, "active": N2VCDeploymentStatus.COMPLETED, }, - EntityType.ACTION: { + "action": { "pending": N2VCDeploymentStatus.PENDING, "running": N2VCDeploymentStatus.RUNNING, "completed": N2VCDeploymentStatus.COMPLETED, }, - EntityType.UNIT: { + "unit": { "waiting": N2VCDeploymentStatus.RUNNING, "maintenance": N2VCDeploymentStatus.RUNNING, "blocked": N2VCDeploymentStatus.RUNNING,