[
https://issues.apache.org/jira/browse/LIBCLOUD-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16145639#comment-16145639
]
Sameh edited comment on LIBCLOUD-926 at 8/29/17 4:56 PM:
---------------------------------------------------------
Hi,
I suggested the following change in pull request #1051:
{{ if location is None:
if self.default_location:
location = self.default_location
else:
raise ValueError("location is required.")
}}
The affected methods are:
{{ ex_create_network_security_group
ex_delete_network_security_group
ex_create_public_ip
}}
The same code has been used in several other places.
Thanks
was (Author: selsharkawy):
Hi,
I suggested the following change in pull request #1051:
if location is None:
if self.default_location:
location = self.default_location
else:
raise ValueError("location is required.")
The affected methods are:
ex_create_network_security_group
ex_delete_network_security_group
ex_create_public_ip
The same code has been used in several other places.
Thanks
> [BUG Azure_ARM] in ex_create_public_ip function among other
> -----------------------------------------------------------
>
> Key: LIBCLOUD-926
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-926
> Project: Libcloud
> Issue Type: Bug
> Components: Compute
> Reporter: Cristina Guerra
> Labels: azurecompute-arm, compute
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> In the file libcloud/compute/drivers/azure_arm.py.
> There are some functions as ex_create_public_ip function that it needs a
> location parameter, when this parameter is send, a error happen: "Location
> is required".
> Looking at the code I found with the following:
> {code:python}
> if location is None and self.default_location:
> location = self.default_location
> else:
> raise ValueError("location is required.")
> {code}
> This does not evaluate a possible parameter, only if the value is None.
> I propose:
> {code:python}
> if location is None and self.default_location:
> location = self.default_location
> elif location is not None:
> location = location
> else:
> raise ValueError("location is required.")
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)