mirror of https://github.com/apache/jclouds.git
Fix SGE.removeSecurityGroup for when the SG doesn't exist
This commit is contained in:
parent
f086c050f9
commit
cb556428e3
|
@ -190,7 +190,15 @@ public class AzureComputeSecurityGroupExtension implements SecurityGroupExtensio
|
||||||
final ResourceGroupAndName resourceGroupAndName = ResourceGroupAndName.fromSlashEncoded(id);
|
final ResourceGroupAndName resourceGroupAndName = ResourceGroupAndName.fromSlashEncoded(id);
|
||||||
URI uri = api.getNetworkSecurityGroupApi(resourceGroupAndName.resourceGroup())
|
URI uri = api.getNetworkSecurityGroupApi(resourceGroupAndName.resourceGroup())
|
||||||
.delete(resourceGroupAndName.name());
|
.delete(resourceGroupAndName.name());
|
||||||
|
|
||||||
|
// https://docs.microsoft.com/en-us/rest/api/network/virtualnetwork/delete-a-network-security-group
|
||||||
|
if (uri != null) {
|
||||||
|
// 202-Accepted if resource exists and the request is accepted.
|
||||||
return resourceDeleted.apply(uri);
|
return resourceDeleted.apply(uri);
|
||||||
|
} else {
|
||||||
|
// 204-No Content if resource does not exist.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue