Fix bug 1216: Remove machines only for native charms
[osm/N2VC.git] / n2vc / utils.py
index 990575d..e8cf64d 100644 (file)
@@ -67,35 +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,
@@ -103,3 +92,11 @@ JujuStatusToOSM = {
         "active": N2VCDeploymentStatus.COMPLETED,
     },
 }
+
+DB_DATA = Dict(
+    {
+        "api_endpoints": Dict(
+            {"table": "admin", "filter": {"_id": "juju"}, "key": "api_endpoints"}
+        )
+    }
+)