mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Rename all of the modules
This is separate from the previous patch - it's just the results of running the script so we can review the two a little independently. We should probably squash them. Change-Id: I838f15cf4a32455a5be20033c8ddc27db6ca15c0
This commit is contained in:
@@ -8,8 +8,8 @@ tests/unit/mock/path.py future-import-boilerplate
|
||||
tests/unit/mock/path.py metaclass-boilerplate
|
||||
tests/unit/mock/yaml_helper.py future-import-boilerplate
|
||||
tests/unit/mock/yaml_helper.py metaclass-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_os_server.py future-import-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_os_server.py metaclass-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_server.py future-import-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_server.py metaclass-boilerplate
|
||||
tests/unit/modules/conftest.py future-import-boilerplate
|
||||
tests/unit/modules/conftest.py metaclass-boilerplate
|
||||
tests/unit/modules/utils.py future-import-boilerplate
|
||||
|
||||
@@ -8,8 +8,8 @@ tests/unit/mock/path.py future-import-boilerplate
|
||||
tests/unit/mock/path.py metaclass-boilerplate
|
||||
tests/unit/mock/yaml_helper.py future-import-boilerplate
|
||||
tests/unit/mock/yaml_helper.py metaclass-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_os_server.py future-import-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_os_server.py metaclass-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_server.py future-import-boilerplate
|
||||
tests/unit/modules/cloud/openstack/test_server.py metaclass-boilerplate
|
||||
tests/unit/modules/conftest.py future-import-boilerplate
|
||||
tests/unit/modules/conftest.py metaclass-boilerplate
|
||||
tests/unit/modules/utils.py future-import-boilerplate
|
||||
|
||||
@@ -3,7 +3,7 @@ import munch
|
||||
|
||||
from mock import patch
|
||||
|
||||
from ansible_collections.openstack.cloud.plugins.modules import os_routers_info
|
||||
from ansible_collections.openstack.cloud.plugins.modules import routers_info
|
||||
from ansible_collections.openstack.cloud.tests.unit.modules.utils import set_module_args, ModuleTestCase, AnsibleExitJson
|
||||
|
||||
|
||||
@@ -164,18 +164,18 @@ class FakeCloud(object):
|
||||
|
||||
class TestRoutersInfo(ModuleTestCase):
|
||||
'''This class calls the main function of the
|
||||
os_routers_info module.
|
||||
openstack.cloud.routers_info module.
|
||||
'''
|
||||
def setUp(self):
|
||||
super(TestRoutersInfo, self).setUp()
|
||||
self.module = os_routers_info
|
||||
self.module = routers_info
|
||||
|
||||
def module_main(self, exit_exc):
|
||||
with self.assertRaises(exit_exc) as exc:
|
||||
self.module.main()
|
||||
return exc.exception.args[0]
|
||||
|
||||
@patch('ansible_collections.openstack.cloud.plugins.modules.os_routers_info.openstack_cloud_from_module', side_effect=openstack_cloud_from_module)
|
||||
@patch('ansible_collections.openstack.cloud.plugins.modules.routers_info.openstack_cloud_from_module', side_effect=openstack_cloud_from_module)
|
||||
def test_main_with_router_interface(self, *args):
|
||||
|
||||
set_module_args({'name': 'router1'})
|
||||
@@ -186,7 +186,7 @@ class TestRoutersInfo(ModuleTestCase):
|
||||
self.assertEqual(result.get('openstack_routers')[0].get('interfaces_info')[0].get('ip_address'), '192.168.1.254')
|
||||
self.assertEqual(result.get('openstack_routers')[0].get('interfaces_info')[0].get('subnet_id'), '0624c75f-0574-41b5-a8d1-92e6e3a9e51d')
|
||||
|
||||
@patch('ansible_collections.openstack.cloud.plugins.modules.os_routers_info.openstack_cloud_from_module', side_effect=openstack_cloud_from_module)
|
||||
@patch('ansible_collections.openstack.cloud.plugins.modules.routers_info.openstack_cloud_from_module', side_effect=openstack_cloud_from_module)
|
||||
def test_main_with_router_gateway(self, *args):
|
||||
|
||||
set_module_args({'name': 'router2'})
|
||||
@@ -194,7 +194,7 @@ class TestRoutersInfo(ModuleTestCase):
|
||||
self.assertIs(type(result.get('openstack_routers')[0].get('interfaces_info')), list)
|
||||
self.assertEqual(len(result.get('openstack_routers')[0].get('interfaces_info')), 0)
|
||||
|
||||
@patch('ansible_collections.openstack.cloud.plugins.modules.os_routers_info.openstack_cloud_from_module', side_effect=openstack_cloud_from_module)
|
||||
@patch('ansible_collections.openstack.cloud.plugins.modules.routers_info.openstack_cloud_from_module', side_effect=openstack_cloud_from_module)
|
||||
def test_main_with_router_interface_and_router_gateway(self, *args):
|
||||
|
||||
set_module_args({'name': 'router3'})
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
import yaml
|
||||
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible_collections.openstack.cloud.plugins.modules import os_server
|
||||
from ansible_collections.openstack.cloud.plugins.modules import server as os_server
|
||||
|
||||
|
||||
class AnsibleFail(Exception):
|
||||
@@ -18,7 +18,7 @@ class AnsibleExit(Exception):
|
||||
|
||||
def params_from_doc(func):
|
||||
'''This function extracts the docstring from the specified function,
|
||||
parses it as a YAML document, and returns parameters for the os_server
|
||||
parses it as a YAML document, and returns parameters for the openstack.cloud.server
|
||||
module.'''
|
||||
|
||||
doc = inspect.getdoc(func)
|
||||
@@ -32,7 +32,7 @@ def params_from_doc(func):
|
||||
task[module] = collections.defaultdict(str,
|
||||
params)
|
||||
|
||||
return cfg[0]['os_server']
|
||||
return cfg[0]['openstack.cloud.server']
|
||||
|
||||
|
||||
class FakeCloud(object):
|
||||
@@ -89,7 +89,7 @@ class FakeCloud(object):
|
||||
|
||||
class TestNetworkArgs(object):
|
||||
'''This class exercises the _network_args function of the
|
||||
os_server module. For each test, we parse the YAML document
|
||||
openstack.cloud.server module. For each test, we parse the YAML document
|
||||
contained in the docstring to retrieve the module parameters for the
|
||||
test.'''
|
||||
|
||||
@@ -100,7 +100,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_string_net_id(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics: net-id=1234
|
||||
'''
|
||||
args = os_server._network_args(self.module, self.cloud)
|
||||
@@ -108,7 +108,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_string_net_id_list(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics: net-id=1234,net-id=4321
|
||||
'''
|
||||
args = os_server._network_args(self.module, self.cloud)
|
||||
@@ -117,7 +117,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_string_port_id(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics: port-id=1234
|
||||
'''
|
||||
args = os_server._network_args(self.module, self.cloud)
|
||||
@@ -125,7 +125,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_string_net_name(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics: net-name=network1
|
||||
'''
|
||||
args = os_server._network_args(self.module, self.cloud)
|
||||
@@ -133,7 +133,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_string_port_name(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics: port-name=port1
|
||||
'''
|
||||
args = os_server._network_args(self.module, self.cloud)
|
||||
@@ -141,7 +141,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_structured_net_id(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics:
|
||||
- net-id: '1234'
|
||||
'''
|
||||
@@ -150,7 +150,7 @@ class TestNetworkArgs(object):
|
||||
|
||||
def test_nics_structured_mixed(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
nics:
|
||||
- net-id: '1234'
|
||||
- port-name: port1
|
||||
@@ -179,7 +179,7 @@ class TestCreateServer(object):
|
||||
|
||||
def test_create_server(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
image: cirros
|
||||
flavor: m1.tiny
|
||||
nics:
|
||||
@@ -197,7 +197,7 @@ class TestCreateServer(object):
|
||||
|
||||
def test_create_server_bad_flavor(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
image: cirros
|
||||
flavor: missing_flavor
|
||||
nics:
|
||||
@@ -211,7 +211,7 @@ class TestCreateServer(object):
|
||||
|
||||
def test_create_server_bad_nic(self):
|
||||
'''
|
||||
- os_server:
|
||||
- openstack.cloud.server:
|
||||
image: cirros
|
||||
flavor: m1.tiny
|
||||
nics:
|
||||
Reference in New Issue
Block a user