GitHub user SElsharkawy reopened a pull request:
https://github.com/apache/libcloud/pull/1098
LIBCLOUD-926 - Propagated changes to azure_arm.py from pull 1051
## Changes Title (Update: LIBCLOUD-926 - [BUG Azure_ARM] in
ex_create_public_ip function among other)
### Description
This suggested update fixes the condition that checks for parameter
"location" being None. If the parameter is not None, the original code would
still exit and raise ValueError exception.
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:
if location is None and self.default_location:
location = self.default_location
else:
raise ValueError("location is required.")
This does not evaluate a possible parameter, only if the value is None.
I suggested the following change:
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.
### Status
done, ready for review
### Checklist (tick everything that applies)
- [ ] [Code
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
(required, can be done after the PR checks)
- [ ] Documentation
- [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ]
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
(required for bigger changes)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/SElsharkawy/libcloud LIBCLOUD-926_pull-1051
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/1098.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1098
----
commit adadaf53882d6e15500079debc7344e5e2d28049
Author: Elsharkawy, Sameh <[email protected]>
Date: 2017-08-29T18:18:19Z
Propagated changes to azure_arm.py from pull 1051
----
---