summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_router.py
AgeCommit message (Collapse)AuthorFilesLines
2018-05-29Fixed issue when attempting to add an internal subnet to a router.spisarski1-1/+1
Internal subnets that are owned by the same user who is creating a router now can be added properly. Attempted to fix an issue with the change in https://gerrit.opnfv.org/gerrit/#/c/57853/ that was allowing for subnets with the same name to be assigned but ended up breaking this functionality completely. JIRA: SNAPS-312 Change-Id: I1687f66db47520e93e401d3e9fb5f0c4f45d460f Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-05-24Miscellaneous minor stability fixesspisarski1-1/+2
Change-Id: Iad8a7b6358f881d1c2935cc619cfa96f1196a675 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-04-29Fix NoneType in create_router.pyCédric Ollivier1-6/+4
It lets Neutron handle str or unicode instead of returning None. It reverts the first proposal [1] which raises side effects [2]. [1] https://gerrit.opnfv.org/gerrit/#/c/56171/ [2] https://build.opnfv.org/ci/view/functest/job/functest-compass-baremetal-daily-master/126/console Change-Id: I1b45c7d6118321dd67343f31253f154abae73655 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-04-21Fix NoneType error when creating routerLinda Wang1-1/+3
Change-Id: Icef5f8a769b5c33da68b7da33ac8ba87132830e2 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-04-19Fixed bug with regards to subnet lookups.spisarski1-9/+28
Neutron returns all subnets regardless of visibility which cause problems within routers if there is another subnet with the same name attached to a different network. JIRA: SNAPS-304 In addition, this patch contains two other minor fixes. launch_utils.py - raise an exception when the creator is not properly instantiated network.py - allow fixed IPs to be none. Change-Id: Ib343074d925be4592a713727a03d5b531890eada Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-03-12Closing keystone sessions after done with them.spisarski1-7/+5
By not closing all of the keystone sessions being created when running all of the tests, this may be the root cause to the IOError occasionally being observed: IOError: [Errno 24] Too many open files JIRA: SNAPS-285 Change-Id: I7fc7ab0c6cdd02f1ae32bb3ae4f121cb465d5693 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-28Ensure project for routers are handled properly.spisarski1-5/+9
Routers should be able to be created by admin users to other projects. Routers without admin users should only be able to create ones to their default project. JIRA: SNAPS-266 Change-Id: I5ecfbcc2ed94bbab211751da9521f3ec1d4ff66d Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-22Changed pattern on how objects lookup themselves by name and project.spisarski1-10/+10
The pattern being replaced has unwittingly added the requirement that all creator credentials must be of type 'admin' as when looking up the associated project ID required a call to keystone.projects.list(). As the SNAPS integration tests were always creating users with an 'admin' role, this issue was not caught. As part of this patch, integration test users will no longer be admin. JIRA: SNAPS-274 Change-Id: I02957f69e31a9d4dfa63362d371f061687e59fbf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-02-16Ensure project IDs are handled correctly for Network/Subnetsspisarski1-3/+6
JIRA: SNAPS-265 Change-Id: If58f5817e52e21be377d2b06a5f7c3a413454350 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-23Added password support for SSH and Ansiblespisarski1-3/+7
Additional protections when initializing network resources Enhanced playbook runner variable support Change-Id: Id897c4ece1de706afbc52d0a034ca3bfb68fdce3 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2018-01-10Added port security flag support to ports.spisarski1-14/+15
Change-Id: Ib66607b7656093c5f0cd0e2cb4c0aa9c3b9c661a Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-20Refactoring of RouterSettings to extend RouterConfigspisarski1-94/+12
RouterSettings and neutron_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the RouterSettings class. JIRA: SNAPS-223 Change-Id: I6a2a5e6e6e86204e62148a57e3525da5862841cf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-11-02Added method to OpenStackHeatStack to return OpenStackRouter objects.spisarski1-4/+3
Continuation of the story SNAPS-153 for adding creator/state machine instances for OpenStack objects deployed via Heat. JIRA: SNAPS-173 Change-Id: Iac9138ef7827c10db1637447d3a909e714a0301b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-10-12Improved creator/state machine classes class hierarchy.spisarski1-47/+67
Created abstract superclasses for all classes responsible for deploying and maintaining the state of objects deployed to OpenStack which should help developers better understand the library. JIRA: SNAPS-183 Change-Id: I7651bd338f0d4e4086abbc11755e6be4f19058bd Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Refactored neutron_utils#get_router_by_name() to get_router()spisarski1-2/+2
Added a router_settings (RouterSettings) object parameter in addition to router_name for more robust query options. JIRA: SNAPS-163 Change-Id: I47672f531171d6ee0c90dabb6641640bf97c1d20 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Merge "Refactored neutron_utils#get_subnet_by_name() to get_subnet()"Steven Pisarski1-2/+2
2017-08-04Refactored neutron_utils#get_subnet_by_name() to get_subnet()spisarski1-2/+2
Renamed utility function and added a subnet_settings parameter to hold a SubnetSettings object to help make the query more robust by being able to leverage values on the settings object. JIRA: SNAPS-165 Change-Id: I226a1217dc4ba7bb50f7d985ecfaf3b7bc4f610b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-03Refactored port retrieval to include PortSettigs.spisarski1-2/+2
Refactored neutron_utils#get_port_by_name to get_port while adding in a port_settings object for more robust query options. JIRA: SNAPS-162 Change-Id: I01222ad344224db94615859448ad05d8d5bc0c30 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-02Refactor network retrieval API calls.spisarski1-3/+2
Refactored neutron_utils#get_network() to also accept a NetworkSettings object for more robust queries in addition to the old network_name parameter. Also refactored neutron_utils# get_network_by_id to add in the ID to list_networks((**{'id': id) and returning the first item contains the expected ID value. JIRA: SNAPS-161 Change-Id: Ie670a442dd70633bbef7a1233e630672ebac6b0c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-31Fixed failing router test on Aricent pod.spisarski1-2/+1
Removed project ID from network lookup for the router_external network as the test test_create_router_admin_user_to_new_project() as the OpenStackRouter object was including its own project ID to the API call causing the network lookup to fail. Note: this is the only pod where this bug has reared it's ugly head. Change-Id: I159252b3f3c3bc418f9947710e9e97d8471ec538 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-28Remove TODOs from create_router.pyspisarski1-4/+2
Determined not to support the optional router attributes: 'enable_snat' & 'external_fixed_ips' at this time. JIRA: SNAPS-150 Change-Id: I68445fb055668f4cb5f2a2ff80499da0f4160043 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-24Fixed problems when setting the OpenStack project ID.spisarski1-2/+3
There were several calls to retrieve the project ID that required named parameters which was causing the utility function to always return None. Additionally, when creating the dict() required by the Neutron create API 'body' parameter key 'project_id' is not supported and still uses 'tenant_id'. As these problems should have been found earlier, this patch also extends the tests for networks, subnets, ports, and security groups to use 'tenant_id' rather than 'project_id'. JIRA: SNAPS-143 Change-Id: Ic69e56145ea6070718d821edd22a1d0f9970995d Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-21Created new classes RouterSettingsError & RouterCreationError.spisarski1-6/+18
Raising RouterSettingsError in RouterSettings and RouterCreationError in OpenStackRouter instead of Exception. JIRA: SNAPS-136 Change-Id: I3ba4824ea80ccfc07b1f15959898936d51bca1de Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain classes for networks and subnets.spisarski1-2/+2
Created Network and Subnet domain classes so neutron_utils.py functions returning these types of objects will not be leaking out implementation details as each API version can change these data structures which is now being handled by the SNAPS neutron utility. JIRA: SNAPS-113 Change-Id: Id95dd0f8c2618c20a1a73a428abb95686dfa8251 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain class for routers.spisarski1-4/+6
Created Router domain class so neutron_utils.py functions returning router objects will not be leaking out implementation details as each API version can change these data structures and this should all be handled by the SNAPS neutron utility. JIRA: SNAPS-115 & SNAPS-14 Change-Id: Ib6d36a735d835a6ed4ede489b14e33a261458fed Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-20Changes to RouterSettings constructors to use kwargs.spisarski1-63/+82
And changed line lengths to 79 for pep8 JIRA: SNAPS-101 Change-Id: I2b63e4130644ad422aa1f81bcf2627e97d97c035 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-16Ensure creators' constructors cannot raise exceptions.spisarski1-1/+3
While creating unit tests for vPing that is using SNAPS, exceptions can be raised when retrieving their respective OpenStack clients with incorrect credentials. Moved client retrieval to the create() method which one should expect exceptions to be raised. JIRA: SNAPS-81 Change-Id: Id8e4279f60b97704b25a89c6312dcf2ebdc3f459 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-08Modified code to support both Python 2.7 and 3.xspisarski1-40/+34
* Tested on Python 2.7.10 and 3.4.4 * Updated installation documentation JIRA: SNAPS-30 Change-Id: I94a37d218be8ea47bbbcfb560197737430fcb3ba Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-02-15Initial patch with all code from CableLabs repository.spisarski1-0/+244
Change-Id: I70a2778718c5e7f21fd14e4ad28c9269d3761cc7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>