Commit Graph

15 Commits

Author SHA1 Message Date
Andreas Jaeger 08c07018dc Fix pep8 and py27, functional jobs
pyflake8 was updated and not properly constrainted by hacking, update
to hacking 3.1.0 and fix the problems found.

py27 failed since global upper-constraints includes py3 only packages.
Use lower-constraints for this test.

The functional jobs run on master with py27, remove the py27 master job,
change the jobs so that py3 is used everywhere.

Change-Id: I695d60e53857e03f206dcd7cf10c06c76c8d6cc0
2020-06-01 07:54:56 -05:00
Toure Dunnon 545b5aae28 python-shade expose MTU setting.
The networking API v2 specification, which is implemented by
openstack neutron, features an optional MTU parameter - when
creating a network, this allows operators to specify the value
for the maximum transmission unit value.

Change-Id: I288f02551555fff3e8b350fc6d7c6ae8f60c405c
2018-07-23 13:06:24 -04:00
Rarm Nagalingam 5b81959b32 Adds toggle port security on network create
Added a new property, 'port_security_enabled' which is a boolean to
enable or disable port_secuirty during network creation. The default
behavior will enable port security, security group and anti spoofing
will act as before. When the attribute is set to False, security
group and anti spoofing are disabled on the ports created on this
network.

Change-Id: If984a82ca5f6fb69ee644f4fa84333df09d7f8bc
2018-03-09 21:05:05 +11:00
Trygve Vea c9bfc45844 Implement availability_zone_hints for networks and routers.
Adds an optional parameter to the create_network and
create_router-methods, for use with availability zone-scheduling of
network agents.

Change-Id: Ifb93a10415dc676f5cc56b5315f2dff24fc395b8
2017-11-27 16:09:41 +01:00
Rui Chen 4e5d46df76 Support to get resource by id
For finding specified resource, we list all the resources in
get_xxx(name_or_id) method, then find the result in list result loop,
that might have poor performance and slow response when there are many
resources in a project. OpenStack API support to get resource by id
directly, and part of them had been implemented in Shade, like:
get_server_by_id(), get_user_by_id(), get_volume_snapshot_by_id.

The patch aims to support more:

- flavor
- image
- volume
- network
- subnet
- port
- floatingip
- security group
- ...

Change-Id: Icb0af21c2d7e8bda07c072cc6098269304b7ab88
Closes-Bug: #1709577
2017-08-11 09:48:48 +08:00
Sławek Kapłoński 950c4500e2 Remove neutronclient mocks from network create tests
Neutronclient mock is replaced by mocking REST calls using
base.RequestsMockTestCase class

Change-Id: Ied57f41694d1c4f934439c52799f4c87794db0a5
2017-04-23 17:22:28 +00:00
Sławek Kapłoński 0a39c015bc Remove neutronclient mocks from network delete tests
Neutronclient mock is replaced by mocking REST calls using
base.RequestsMockTestCase class

Change-Id: I71df04e886d0c08ca29fe141f41961d833138b74
2017-04-22 20:43:00 +00:00
Sławek Kapłoński e61a5c0418 Remove neutronclient mocks from network list tests
Neutronclient mock is replaced by mocking REST calls using
base.RequestsMockTestCase class

Change-Id: I8fd72845afa62fa5fdf351c666d23aae31757bba
2017-04-22 09:35:50 +00:00
Sławek Kapłoński 5dae1875ec Move unit tests for list networks to test_network.py file
This file is place where all tests related to networks
lives so tests for list_networks should be also there.

Change-Id: I3aa7254f66a100d269deefef725dff036488efd2
2017-04-21 21:03:58 +00:00
Monty Taylor 2556c33859
Make shared an optional keyword param to create_network
shared as a parameter can only be passed by admins.

Change-Id: I26c800f6ecba127d4ef4683a18ad2aafefa63606
Story: #2000696
2016-08-09 09:26:52 -05:00
Monty Taylor e6b60d99c8 Refactor unit tests to construct cloud in base
There is no need to construct a cloud individually in each unit test.
Further more, we can now just use the enable-inner-exception interface
introduced a few patches ago.

Change-Id: Ia45a47ec243c917ab05b5a2f95c449b9e8d1da68
2016-03-19 13:24:34 -05:00
Ricardo Carrillo Cruz d0709ead25 Allow passing project_id to create_network
The neutron net-create verb allows passing a tenant_id param,
allowing a cloud admin to create networks on any projects is
granted to.
This change allows passing this param, which is an admin-only
option.

Change-Id: I76285ad1f7106f9a5900f118cdc7a5012786869d
2016-03-08 20:35:09 +00:00
David Shrewsbury 11a8527558 Add support for provider network options
This has been asked for by the Ansible community.

Change-Id: Ib11beb42901cdf6b5c9a5d8f8e3a2a0f2fbf382d
2016-02-19 16:07:37 +00:00
David Shrewsbury 4c8cfe4b18 Improve test coverage: network delete API
Add missing unit tests for delete_network() API method.

Change-Id: I75ab31ddeb731d192a0266712bfb95c5f21c8acb
2015-12-08 20:28:16 +00:00
David Shrewsbury 2cc62575e7 Do not send 'router:external' unless it is set
There are some setups where sending 'router:external' can
produce a Forbidden error. For an example, see:

  https://github.com/ansible/ansible-modules-core/issues/2435

Let's not send it unless it is explicitly set to True.

Change-Id: I59c43bf3eab09ed620cd1e8e5e445037767eb8bb
2015-11-21 14:28:37 +00:00