mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Fix for updating the name in case of host record and network view and also display meaningful error in case of connection timeout (#40597)
* To fix following github issues 35774, 36574 and 39494 * To fix following github issues 35774, 36574 and 39494 * To fix following github issues 35774, 36574 and 39494 * To fix following github issues 35774, 36574 and 39494 * To fix following github issues 35774, 36574 and 39494 * To fix following github issues 35774, 36574 and 39494 * removed old_name new entry to make ui cleaner * removed old_name new entry to make ui cleaner * removed old_name new entry to make ui cleaner * removed old_name new entry to make ui cleaner * removed old_name new entry to make ui cleaner * removed old_name new entry to make ui cleaner * to resolve the bug 40709 * reslove shippable error * reslove shippable error * reslove shippable error * reslove shippable error * reslove shippable error * reslove shippable error * reslove shippable error * reslove shippable error * reslove shippable error * to fix shippable nios automation error * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * modified the name input parsing method * shippable error fix * shippable error fix * shippable error fix * shippable error fix * shippable error fix * review comment fix * shippable error fix * shippable error fix
This commit is contained in:
@@ -75,7 +75,7 @@ class TestNiosDnsViewModule(TestNiosModule):
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': 'ansible-dns'})
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': self.module._check_type_dict().__getitem__()})
|
||||
|
||||
def test_nios_dns_view_update_comment(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': 'ansible-dns',
|
||||
|
||||
@@ -64,7 +64,6 @@ class TestNiosHostRecordModule(TestNiosModule):
|
||||
'comment': None, 'extattrs': None}
|
||||
|
||||
test_object = None
|
||||
|
||||
test_spec = {
|
||||
"name": {"ib_req": True},
|
||||
"comment": {},
|
||||
@@ -76,7 +75,7 @@ class TestNiosHostRecordModule(TestNiosModule):
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': 'ansible'})
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': self.module._check_type_dict().__getitem__()})
|
||||
|
||||
def test_nios_host_record_remove(self):
|
||||
self.module.params = {'provider': None, 'state': 'absent', 'name': 'ansible',
|
||||
@@ -128,7 +127,7 @@ class TestNiosHostRecordModule(TestNiosModule):
|
||||
wapi.update_object.called_once_with(test_object)
|
||||
|
||||
def test_nios_host_record_update_record_name(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': 'default', 'old_name': 'old_default',
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': {'new_name': 'default', 'old_name': 'old_default'},
|
||||
'comment': 'comment', 'extattrs': None}
|
||||
|
||||
test_object = [
|
||||
|
||||
@@ -100,20 +100,20 @@ class TestNiosNetworkModule(TestNiosModule):
|
||||
self.assertTrue(res['changed'])
|
||||
|
||||
def test_nios_network_ipv6_dhcp_update(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'network': 'fe80::/64',
|
||||
self.module.params = {'provider': None, 'state': 'present', 'ipv6network': 'fe80::/64',
|
||||
'comment': 'updated comment', 'extattrs': None}
|
||||
|
||||
test_object = [
|
||||
{
|
||||
"comment": "test comment",
|
||||
"_ref": "ipv6network/ZG5zLm5ldHdvcmtfdmlldyQw:default/true",
|
||||
"network": "fe80::/64",
|
||||
"ipv6network": "fe80::/64",
|
||||
"extattrs": {'options': {'name': 'test', 'value': 'ansible.com'}}
|
||||
}
|
||||
]
|
||||
|
||||
test_spec = {
|
||||
"network": {"ib_req": True},
|
||||
"ipv6network": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
@@ -148,13 +148,13 @@ class TestNiosNetworkModule(TestNiosModule):
|
||||
wapi.delete_object.assert_called_once_with(ref)
|
||||
|
||||
def test_nios_network_ipv6_create(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'network': 'fe80::/64',
|
||||
self.module.params = {'provider': None, 'state': 'present', 'ipv6network': 'fe80::/64',
|
||||
'comment': None, 'extattrs': None}
|
||||
|
||||
test_object = None
|
||||
|
||||
test_spec = {
|
||||
"network": {"ib_req": True},
|
||||
"ipv6network": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
@@ -164,10 +164,10 @@ class TestNiosNetworkModule(TestNiosModule):
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.create_object.assert_called_once_with('testobject', {'network': 'fe80::/64'})
|
||||
wapi.create_object.assert_called_once_with('testobject', {'ipv6network': 'fe80::/64'})
|
||||
|
||||
def test_nios_network_ipv6_remove(self):
|
||||
self.module.params = {'provider': None, 'state': 'absent', 'network': 'fe80::/64',
|
||||
self.module.params = {'provider': None, 'state': 'absent', 'ipv6network': 'fe80::/64',
|
||||
'comment': None, 'extattrs': None}
|
||||
|
||||
ref = "ipv6network/ZG5zLm5ldHdvcmtfdmlldyQw:ansible/false"
|
||||
@@ -175,12 +175,12 @@ class TestNiosNetworkModule(TestNiosModule):
|
||||
test_object = [{
|
||||
"comment": "test comment",
|
||||
"_ref": ref,
|
||||
"network": "fe80::/64",
|
||||
"ipv6network": "fe80::/64",
|
||||
"extattrs": {'Site': {'value': 'test'}}
|
||||
}]
|
||||
|
||||
test_spec = {
|
||||
"network": {"ib_req": True},
|
||||
"ipv6network": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class TestNiosNetworkViewModule(TestNiosModule):
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': 'ansible'})
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': self.module._check_type_dict().__getitem__()})
|
||||
|
||||
def test_nios_network_view_update_comment(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': 'default',
|
||||
|
||||
@@ -59,13 +59,13 @@ class TestNiosZoneModule(TestNiosModule):
|
||||
self.load_config.return_value = dict(diff=None, session='session')
|
||||
|
||||
def test_nios_zone_create(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': 'ansible.com',
|
||||
self.module.params = {'provider': None, 'state': 'present', 'fqdn': 'ansible.com',
|
||||
'comment': None, 'extattrs': None}
|
||||
|
||||
test_object = None
|
||||
|
||||
test_spec = {
|
||||
"name": {"ib_req": True},
|
||||
"fqdn": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
@@ -75,10 +75,10 @@ class TestNiosZoneModule(TestNiosModule):
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.create_object.assert_called_once_with('testobject', {'name': 'ansible.com'})
|
||||
wapi.create_object.assert_called_once_with('testobject', {'fqdn': 'ansible.com'})
|
||||
|
||||
def test_nios_zone_remove(self):
|
||||
self.module.params = {'provider': None, 'state': 'absent', 'name': 'ansible.com',
|
||||
self.module.params = {'provider': None, 'state': 'absent', 'fqdn': 'ansible.com',
|
||||
'comment': None, 'extattrs': None}
|
||||
|
||||
ref = "zone/ZG5zLm5ldHdvcmtfdmlldyQw:ansible/false"
|
||||
@@ -86,12 +86,12 @@ class TestNiosZoneModule(TestNiosModule):
|
||||
test_object = [{
|
||||
"comment": "test comment",
|
||||
"_ref": ref,
|
||||
"name": "ansible.com",
|
||||
"fqdn": "ansible.com",
|
||||
"extattrs": {'Site': {'value': 'test'}}
|
||||
}]
|
||||
|
||||
test_spec = {
|
||||
"name": {"ib_req": True},
|
||||
"fqdn": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
@@ -102,20 +102,20 @@ class TestNiosZoneModule(TestNiosModule):
|
||||
wapi.delete_object.assert_called_once_with(ref)
|
||||
|
||||
def test_nios_zone_update_comment(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': 'ansible.com',
|
||||
self.module.params = {'provider': None, 'state': 'present', 'fqdn': 'ansible.com',
|
||||
'comment': 'updated comment', 'extattrs': None}
|
||||
|
||||
test_object = [
|
||||
{
|
||||
"comment": "test comment",
|
||||
"_ref": "zone/ZG5zLm5ldHdvcmtfdmlldyQw:default/true",
|
||||
"name": "ansible.com",
|
||||
"fqdn": "ansible.com",
|
||||
"extattrs": {'Site': {'value': 'test'}}
|
||||
}
|
||||
]
|
||||
|
||||
test_spec = {
|
||||
"name": {"ib_req": True},
|
||||
"fqdn": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user