-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue: LIBCLOUD-477 Add list/delete/create network (VPC) calls within EC... #203
Issue: LIBCLOUD-477 Add list/delete/create network (VPC) calls within EC... #203
Conversation
params = {'Action': 'DescribeVpcs'} | ||
|
||
result = self.connection.request(self.path, | ||
params=params.copy()).object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is .copy
call necessary here?
request
method shouldn't mutate params
so the copy call here should be unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly isn't, just came over with a copy paste from a different call :).
Pulling in latest updates
Updated list/delete network tests
Pulling in latest changes
result = self.connection.request(self.path, params=params).object | ||
|
||
# Get our properties | ||
response = {'vpc_id': findtext(element=result, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should now also return EC2Network
instance.
Something like network = self._to_network(elem=respose.object
should do (you might need to select a correct element first though).
You can then also pass this instance to self.ex_create_tags
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also appreciate if you could synchronize your branch with trunk after you make those changes.
Otherwise I will have a bad time merging this patch since there will be a bunch of merge conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup my fault on that. I'll make sure to synchronize my branch before submitting future PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem and thanks for all those PRs :)
Conflicts: libcloud/compute/drivers/ec2.py libcloud/test/compute/test_ec2.py
Updated test_ex_create_network accordingly
|
||
return network | ||
|
||
def ex_delete_network(self, vpc_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have EC2Network
class, this method should take an instance of this class to be consistent with other methods (delete_key_pair, destroy_volume, etc.).
If you only have an ID, you can always constructor the EC2Network
object manually and pass it to this method to avoid the ex_list_networks
call.
@cderamus I went ahead, made the "ex_delete_network" change mentioned above and merged changes into trunk. I had some issues (conflicts) with applying the patch and squashing the commits so I just went ahead and directly merged your branch into trunk. |
...2