summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/neutron_utils_tests.py
AgeCommit message (Collapse)AuthorFilesLines
2017-08-09SNAPS Stack creators can now return SNAPS network creators.spisarski1-9/+51
As Heat Stacks are responsible for spawning objects in OpenStack, the class OpenStackHeatStack which is responsible for applying and managing the state of a stack now can retrieve OpenStackNetwork objects for the networks created in the stack for clients who would like to query the networks and subnets or update them outside of Heat. JIRA: SNAPS-171 Change-Id: I9bf0b81d4f7bfeb1b6392f345022c7d9a57d0415 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-07Refactored neutron_utils#get_router_by_name() to get_router()spisarski1-1/+1
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-07Refactored neutron_utils#get_security_group()spisarski1-9/+9
Added a sec_grp_settings (SecurityGroupSettings) object parameter in addition to sec_grp_name for more robust query options. JIRA: SNAPS-164 Change-Id: I8bb21ff9e5e6b1f532773ca01d37964f8b47b530 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-08-04Refactored neutron_utils#get_subnet_by_name() to get_subnet()spisarski1-39/+24
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-02Refactor network retrieval API calls.spisarski1-2/+3
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-24Added validation router is attached to the external network.spisarski1-1/+4
Verifying that the external network's ID is the same as the 'network_id' value in router.external_gateway_info. JIRA: SNAPS-145 Change-Id: I60795c69679f6e439e6e102115e228a65572db52 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-18Merge "Created new class NeutronException."Steven Pisarski1-2/+3
2017-07-17Last task necessary to stop users from easily obtaining OS objects.spisarski1-1/+1
Changed external interfaces still exposing OpenStack created APIs to either return SNAPS-OO domain objects or objects contained on the OpenStack generated objects as to not leak implementation details that would eventually break the library when new API versions are released. JIRA: SNAPS-125 Change-Id: Iab6d6d298c4c5da68daed4b1b252313a1595a295 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-17Created new class NeutronException.spisarski1-2/+3
Raising NeutronException in neutron_utils.py instead of Exception. JIRA: SNAPS-128 Change-Id: I567db38a5dfcaae9bbfc6c74558521b0e28d9d46 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-13Created domain classes for networks and subnets.spisarski1-104/+75
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/+4
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-07-13Created domain class for ports.spisarski1-1/+1
Create Port domain class so neutron_utils.py functions returning port 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-118 Change-Id: If031a094a9da284e2838691c3b3490359f710c61 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-07-11Created domain classes for security groups.spisarski1-25/+13
Created SecurityGroup and SecurityGroupRule classes so the neutron_utils for security groups will be returning objects of these types instead of the OpenStack objects returned by the API calls. JIRA: SNAPS-116 Change-Id: I76ed1f85f7d54b984fc6f6ac28cee7680a1109e5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-06-22Use neutron to create floating IPs.spisarski1-222/+464
This patch moves the floating IP creation out of nova and into neutron. Other changes include the use of domain objects for VM and Floating IP instances, addition of new nova_utils tests to exercise the create server functionality, and more PEP8 compliance. JIRA: SNAPS-92 Change-Id: I16c12b26b56008901633e90ae307586ad2045f9b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
2017-05-17bugfix: get_security_group_by_id always return first elementMorgan Richomme1-20/+43
add check on id before return value fixed kwarg into the neutron.list_security_groups to the correct one 'id' added unit test to ensure this function always works as designed JIRA: SNAPS-82 Change-Id: I965e1dd54fd1efa8c2d7f6efb87c78ab24cca0e5 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-05-08Modified code to support both Python 2.7 and 3.xspisarski1-4/+6
* 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/+651
Change-Id: I70a2778718c5e7f21fd14e4ad28c9269d3761cc7 Signed-off-by: spisarski <s.pisarski@cablelabs.com>