mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
fix bugs for ce (#54750)
* Update ce.py
while to_text(out, errors='surrogate_then_replace').strip().endswith(']'):
display.vvvv('wrong context, sending exit to device', self._play_context.remote_addr)
conn.exec_command('return')
out = conn.get_prompt()
connetion has no send_command function and ce device has no 'exit' command to return user-view(a correct context),but 'return' .command.
* Add files via upload
Some bugs fix.
* Add files via upload
fix some bugs
* fix a bug for ce_command
Running a command with prompt via ce_command, It doesn't work.The reason is that the key word for network_cli recognition is answer not response.
* fix bugs
fix bugs for ce modules
* Update ce.py
* Delete ce_ftp.py
need modify
* Delete ce_lacp.py
* Add files via upload
* Delete ce_aaa_server.py
* Delete ce_aaa_server_host.py
* Compatible with Python 3
Compatible with Python 3 and fix bugs for ce
* Update ce_aaa_server.py
* Add files via upload
modify doc
* Add files via upload
Compatible with Python 3 and fix bugs
* Add files via upload
Compatible with Python 3 and fix bugs
* Add files via upload
Cancellation of change
* Update ce_netconf.py
It is a bug that response has no xml attribute:line 183
* Add files via upload
* Add files via upload
Compatible with Python 3 and fix bugs
* updatp ce_config.py
a bug for this module.
This commit is contained in:
committed by
Ganesh Nalawade
parent
f8bebc61c8
commit
1017f15c38
@@ -46,6 +46,7 @@ options:
|
||||
- Preferred authentication mode.
|
||||
type: str
|
||||
choices: ['invalid', 'local', 'hwtacacs', 'radius', 'none']
|
||||
default: local
|
||||
author_scheme_name:
|
||||
description:
|
||||
- Name of an authorization scheme.
|
||||
@@ -56,6 +57,7 @@ options:
|
||||
- Preferred authorization mode.
|
||||
type: str
|
||||
choices: ['invalid', 'local', 'hwtacacs', 'if-authenticated', 'none']
|
||||
default: local
|
||||
acct_scheme_name:
|
||||
description:
|
||||
- Accounting scheme name.
|
||||
@@ -66,6 +68,7 @@ options:
|
||||
- Accounting Mode.
|
||||
type: str
|
||||
choices: ['invalid', 'hwtacacs', 'radius', 'none']
|
||||
default: none
|
||||
domain_name:
|
||||
description:
|
||||
- Name of a domain.
|
||||
@@ -762,16 +765,15 @@ class AaaServer(object):
|
||||
conf_str = CE_GET_AUTHENTICATION_SCHEME
|
||||
|
||||
xml_str = self.netconf_get_config(module=module, conf_str=conf_str)
|
||||
|
||||
result = list()
|
||||
|
||||
if "<data/>" in xml_str:
|
||||
return result
|
||||
else:
|
||||
re_find = re.findall(
|
||||
r'.*<firstAuthenMode>(.*)</firstAuthenMode>.*\s*'
|
||||
r'<secondAuthenMode>(.*)</secondAuthenMode>.*\s*'
|
||||
r'<authenSchemeName>(.*)</authenSchemeName>.*', xml_str)
|
||||
r'.*<authenSchemeName>(.*)</authenSchemeName>.*\s*'
|
||||
r'<firstAuthenMode>(.*)</firstAuthenMode>.*\s*'
|
||||
r'<secondAuthenMode>(.*)</secondAuthenMode>.*\s*', xml_str)
|
||||
|
||||
if re_find:
|
||||
return re_find
|
||||
@@ -947,16 +949,15 @@ class AaaServer(object):
|
||||
conf_str = CE_GET_AUTHORIZATION_SCHEME
|
||||
|
||||
xml_str = self.netconf_get_config(module=module, conf_str=conf_str)
|
||||
|
||||
result = list()
|
||||
|
||||
if "<data/>" in xml_str:
|
||||
return result
|
||||
else:
|
||||
re_find = re.findall(
|
||||
r'.*<firstAuthorMode>(.*)</firstAuthorMode>.*\s*'
|
||||
r'<secondAuthorMode>(.*)</secondAuthorMode>.*\s*'
|
||||
r'<authorSchemeName>(.*)</authorSchemeName>.*', xml_str)
|
||||
r'.*<authorSchemeName>(.*)</authorSchemeName>.*\s*'
|
||||
r'<firstAuthorMode>(.*)</firstAuthorMode>.*\s*'
|
||||
r'<secondAuthorMode>(.*)</secondAuthorMode>.*\s*', xml_str)
|
||||
|
||||
if re_find:
|
||||
return re_find
|
||||
@@ -1132,16 +1133,12 @@ class AaaServer(object):
|
||||
conf_str = CE_GET_ACCOUNTING_SCHEME
|
||||
|
||||
xml_str = self.netconf_get_config(module=module, conf_str=conf_str)
|
||||
|
||||
result = list()
|
||||
|
||||
if "<data/>" in xml_str:
|
||||
return result
|
||||
else:
|
||||
re_find = re.findall(
|
||||
r'.*<accountingMode>(.*)</accountingMode>.*\s*'
|
||||
r'<acctSchemeName>(.*)</acctSchemeName>.*', xml_str)
|
||||
|
||||
re_find = re.findall(r'.*<acctSchemeName>(.*)</acctSchemeName>\s*<accountingMode>(.*)</accountingMode>', xml_str)
|
||||
if re_find:
|
||||
return re_find
|
||||
else:
|
||||
@@ -1676,25 +1673,20 @@ def check_module_argument(**kwargs):
|
||||
module.fail_json(
|
||||
msg='Error: local_user_group %s '
|
||||
'is large than 32.' % local_user_group)
|
||||
check_name(module=module, name=local_user_group,
|
||||
invalid_char=INVALID_GROUP_CHAR)
|
||||
check_name(module=module, name=local_user_group, invalid_char=INVALID_GROUP_CHAR)
|
||||
|
||||
|
||||
def main():
|
||||
""" Module main """
|
||||
|
||||
argument_spec = dict(
|
||||
state=dict(choices=['present', 'absent'],
|
||||
default='present'),
|
||||
state=dict(choices=['present', 'absent'], default='present'),
|
||||
authen_scheme_name=dict(type='str'),
|
||||
first_authen_mode=dict(choices=['invalid', 'local',
|
||||
'hwtacacs', 'radius', 'none']),
|
||||
first_authen_mode=dict(default='local', choices=['invalid', 'local', 'hwtacacs', 'radius', 'none']),
|
||||
author_scheme_name=dict(type='str'),
|
||||
first_author_mode=dict(choices=['invalid', 'local',
|
||||
'hwtacacs', 'if-authenticated', 'none']),
|
||||
first_author_mode=dict(default='local', choices=['invalid', 'local', 'hwtacacs', 'if-authenticated', 'none']),
|
||||
acct_scheme_name=dict(type='str'),
|
||||
accounting_mode=dict(choices=['invalid', 'hwtacacs',
|
||||
'radius', 'none']),
|
||||
accounting_mode=dict(default='none', choices=['invalid', 'hwtacacs', 'radius', 'none']),
|
||||
domain_name=dict(type='str'),
|
||||
radius_server_group=dict(type='str'),
|
||||
hwtacas_template=dict(type='str'),
|
||||
@@ -1758,8 +1750,7 @@ def main():
|
||||
if authen_scheme_name:
|
||||
|
||||
scheme_exist = ce_aaa_server.get_authentication_scheme(module=module)
|
||||
scheme_new = (first_authen_mode.lower(), "invalid",
|
||||
authen_scheme_name.lower())
|
||||
scheme_new = (authen_scheme_name.lower(), first_authen_mode.lower(), "invalid")
|
||||
|
||||
existing["authentication scheme"] = scheme_exist
|
||||
|
||||
@@ -1843,8 +1834,7 @@ def main():
|
||||
if author_scheme_name:
|
||||
|
||||
scheme_exist = ce_aaa_server.get_authorization_scheme(module=module)
|
||||
scheme_new = (first_author_mode.lower(), "invalid",
|
||||
author_scheme_name.lower())
|
||||
scheme_new = (author_scheme_name.lower(), first_author_mode.lower(), "invalid")
|
||||
|
||||
existing["authorization scheme"] = scheme_exist
|
||||
|
||||
@@ -1925,7 +1915,7 @@ def main():
|
||||
if acct_scheme_name:
|
||||
|
||||
scheme_exist = ce_aaa_server.get_accounting_scheme(module=module)
|
||||
scheme_new = (accounting_mode.lower(), acct_scheme_name.lower())
|
||||
scheme_new = (acct_scheme_name.lower(), accounting_mode.lower())
|
||||
|
||||
existing["accounting scheme"] = scheme_exist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user