Fix LCM evacuate issue
[appc.git] / appc-adapters / appc-iaas-adapter / appc-iaas-adapter-bundle / src / main / java / org / onap / appc / adapter / iaas / provider / operation / impl / EvacuateServer.java
index 4715860..2ce8ab4 100644 (file)
@@ -8,6 +8,8 @@
  * ================================================================================
  * Modifications Copyright (C) 2019 Ericsson
  * =============================================================================
+ * Modification Copyright (C) 2019 IBM
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -121,6 +123,7 @@ public class EvacuateServer extends ProviderServerOperation {
             String targetHost) throws ZoneException, RequestFailedException {
         String msg;
         Context ctx = server.getContext();
+        rcCtx.reset();
         while (rcCtx.attempt()) {
             try {
                 logger.debug("Calling CDP moveServer - server id = " + server.getId());
@@ -359,7 +362,7 @@ public class EvacuateServer extends ProviderServerOperation {
     }
 
     private void setTimeForMetricsLogger() {
-        String timestamp = LoggingUtils.generateTimestampStr(((Date) new Date()).toInstant());
+        String timestamp = LoggingUtils.generateTimestampStr((new Date()).toInstant());
         MDC.put(LoggingConstants.MDCKeys.BEGIN_TIMESTAMP, timestamp);
         MDC.put(LoggingConstants.MDCKeys.END_TIMESTAMP, timestamp);
         MDC.put(LoggingConstants.MDCKeys.ELAPSED_TIME, "0");