- if (url != null) {\r
- for (Endpoint endpoint : getEndpoints(ServiceCatalog.COMPUTE_SERVICE)) {\r
- String endpointUrl = endpoint.getPublicURL();\r
- Matcher matcher = urlPattern.matcher(endpointUrl);\r
- if (matcher.matches()) {\r
- if (url.getHost().equals(matcher.group(1))) {\r
- if (url.getPort() != null) {\r
- if (!url.getPort().equals(matcher.group(2))) {\r
- continue;\r
- }\r
- }\r
-\r
- region = endpoint.getRegion();\r
- break;\r
- }\r
- }\r
+ for (Endpoint endpoint : getEndpoints(ServiceCatalog.COMPUTE_SERVICE)) {\r
+ String endpointUrl = endpoint.getPublicURL();\r
+ Matcher matcher = urlPattern.matcher(endpointUrl);\r
+ if (!matcher.matches() ||\r
+ !url.getHost().equals(matcher.group(1)) ||\r
+ (url.getPort() != null && url.getPort().equals(matcher.group(2))) ) {\r
+ continue;\r