Add reason for rApp instance deploy/undeploy failure
[nonrtric/plt/rappmanager.git] / rapp-manager-acm / src / main / java / com / oransc / rappmanager / acm / service / AcmDeployer.java
index eb93ed3..0cfeb9b 100755 (executable)
@@ -139,6 +139,8 @@ public class AcmDeployer implements RappDeployer {
         } catch (Exception e) {
             logger.warn("Error in deploying Rapp", e);
         }
+        rappInstanceStateMachine.sendRappInstanceEvent(rappInstance, RappEvent.ACMDEPLOYFAILED);
+        rappInstance.setReason("Unable to deploy ACM");
         return false;
     }
 
@@ -158,6 +160,8 @@ public class AcmDeployer implements RappDeployer {
                 return true;
             }
         }
+        rappInstanceStateMachine.sendRappInstanceEvent(rappInstance, RappEvent.ACMUNDEPLOYFAILED);
+        rappInstance.setReason("Unable to undeploy ACM");
         return false;
     }
 
@@ -173,11 +177,12 @@ public class AcmDeployer implements RappDeployer {
                 primeACMComposition(commissioningResponse.getCompositionId(), PrimeOrder.PRIME);
                 return true;
             } else {
-                logger.error("Failed to create automation composition");
+                logger.warn("Failed to create automation composition");
             }
         } catch (Exception e) {
-            logger.error("Failed to create automation composition", e);
+            logger.warn("Error in creating automation composition", e);
         }
+        rapp.setReason("Unable to create automation composition");
         return false;
     }
 
@@ -190,8 +195,9 @@ public class AcmDeployer implements RappDeployer {
                 return true;
             }
         } catch (Exception e) {
-            logger.error("Failed deprime automation composition", e);
+            logger.warn("Failed deprime automation composition", e);
         }
+        rapp.setReason("Unable to delete automation composition");
         return false;
     }