Skip to content

Commit dd46539

Browse files
author
Carroll Chiou
authored
remove redundant cloudName (#457)
1 parent 01789a6 commit dd46539

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/main/java/com/microsoft/azure/vmagent/AzureVMCloud.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ public class AzureVMCloud extends Cloud {
9494
private static final int DEFAULT_SSH_CONNECT_RETRY_COUNT = 3;
9595
private static final int SHH_CONNECT_RETRY_INTERNAL_SECONDS = 20;
9696

97-
private final String cloudName;
98-
9997
private final String credentialsId;
10098

10199
private final int maxVirtualMachinesLimit;
@@ -159,7 +157,6 @@ public AzureVMCloud(
159157
this.existingResourceGroupName = existingResourceGroupName;
160158
this.resourceGroupName = getResourceGroupName(
161159
resourceGroupReferenceType, newResourceGroupName, existingResourceGroupName);
162-
this.cloudName = getOrGenerateCloudName(cloudName, azureCredentialsId, this.resourceGroupName);
163160

164161
if (StringUtils.isBlank(maxVirtualMachinesLimit) || !maxVirtualMachinesLimit.matches(Constants.REG_EX_DIGIT)) {
165162
this.maxVirtualMachinesLimit = Constants.DEFAULT_MAX_VM_LIMIT;
@@ -268,7 +265,7 @@ public static String getResourceGroupName(String type, String newName, String ex
268265
}
269266

270267
public String getCloudName() {
271-
return cloudName;
268+
return this.name;
272269
}
273270

274271
public static String getOrGenerateCloudName(String cloudName, String credentialId, String resourceGroupName) {
@@ -616,7 +613,7 @@ public Collection<PlannedNode> provision(CloudState cloudState, int workLoad) {
616613
final List<PlannedNode> plannedNodes = new ArrayList<>(numberOfAgents);
617614

618615
if (!template.getTemplateProvisionStrategy().isVerifiedPass()) {
619-
AzureVMCloudVerificationTask.verify(cloudName, template.getTemplateName());
616+
AzureVMCloudVerificationTask.verify(this.name, template.getTemplateName());
620617
}
621618
if (template.getTemplateProvisionStrategy().isVerifiedFailed()) {
622619
LOGGER.log(Level.INFO, "Template {0} has just verified failed", template.getTemplateName());

0 commit comments

Comments
 (0)