Commit afef04cb authored by Mohamed Khalil Labidi's avatar Mohamed Khalil Labidi
Browse files

Fix TargetProvider creation in EMS Deployment request creation

parent 45d73b04
......@@ -385,7 +385,7 @@ public class PAGateway {
nodeNames.forEach(node -> {
Deployment deployment = EntityManagerHelper.find(Deployment.class,node);
PACloud cloud = deployment.getPaCloud();
EmsDeploymentRequest req = new EmsDeploymentRequest(authorizationBearer, baguetteIp, baguettePort, OperatingSystemFamily.fromValue(operatingSystem), targetType, deployment.getNodeName(), EmsDeploymentRequest.TargetProvider.valueOf(cloud.getCloudProviderName()), deployment.getLocationName(), isUsingHttps, deployment.getNodeName());
EmsDeploymentRequest req = new EmsDeploymentRequest(authorizationBearer, baguetteIp, baguettePort, OperatingSystemFamily.fromValue(operatingSystem), targetType, deployment.getNodeName(), EmsDeploymentRequest.TargetProvider.fromValue(cloud.getCloudProviderName()), deployment.getLocationName(), isUsingHttps, deployment.getNodeName());
deployment.setEmsDeployment(req);
EntityManagerHelper.persist(deployment);
});
......
......@@ -5,6 +5,7 @@ import org.ow2.proactive.scheduler.common.task.TaskVariable;
import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@Entity
......@@ -43,6 +44,15 @@ public class EmsDeploymentRequest implements Serializable {
}
String upperwareValue;
public static TargetProvider fromValue(String text) {
for (TargetProvider b : TargetProvider.values()) {
if (String.valueOf(b.upperwareValue).equals(text.toUpperCase(Locale.ROOT))) {
return b;
}
}
return null;
}
}
@Id
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment