Skip to content

Commit

Permalink
update ce_aaa_server to fix bugs (ansible#60270)
Browse files Browse the repository at this point in the history
* update ce_aaa_server to fix bugs

* update ce_aaa_server to fix bugs
  • Loading branch information
yanzhangi authored and ansibot committed Aug 8, 2019
1 parent 66c3e9b commit c2e7683
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions lib/ansible/modules/network/cloudengine/ce_aaa_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,20 +1797,21 @@ def main():

else:
# absent authentication scheme
if len(scheme_exist) == 0:
pass
elif scheme_new not in scheme_exist:
pass
else:
cmd = ce_aaa_server.delete_authentication_scheme(
module=module,
authen_scheme_name=authen_scheme_name,
first_authen_mode=first_authen_mode)
updates.append(cmd)
changed = True
if not domain_name:
if len(scheme_exist) == 0:
pass
elif scheme_new not in scheme_exist:
pass
else:
cmd = ce_aaa_server.delete_authentication_scheme(
module=module,
authen_scheme_name=authen_scheme_name,
first_authen_mode=first_authen_mode)
updates.append(cmd)
changed = True

# absent authentication domain
if domain_name:
else:
domain_exist = ce_aaa_server.get_authentication_domain(
module=module)
domain_new = (domain_name.lower(), authen_scheme_name.lower())
Expand Down Expand Up @@ -1878,20 +1879,21 @@ def main():

else:
# absent authorization scheme
if len(scheme_exist) == 0:
pass
elif scheme_new not in scheme_exist:
pass
else:
cmd = ce_aaa_server.delete_authorization_scheme(
module=module,
author_scheme_name=author_scheme_name,
first_author_mode=first_author_mode)
updates.append(cmd)
changed = True
if not domain_name:
if len(scheme_exist) == 0:
pass
elif scheme_new not in scheme_exist:
pass
else:
cmd = ce_aaa_server.delete_authorization_scheme(
module=module,
author_scheme_name=author_scheme_name,
first_author_mode=first_author_mode)
updates.append(cmd)
changed = True

# absent authorization domain
if domain_name:
else:
domain_exist = ce_aaa_server.get_authorization_domain(
module=module)
domain_new = (domain_name.lower(), author_scheme_name.lower())
Expand Down Expand Up @@ -1959,20 +1961,21 @@ def main():

else:
# absent accounting scheme
if len(scheme_exist) == 0:
pass
elif scheme_new not in scheme_exist:
pass
else:
cmd = ce_aaa_server.delete_accounting_scheme(
module=module,
acct_scheme_name=acct_scheme_name,
accounting_mode=accounting_mode)
updates.append(cmd)
changed = True
if not domain_name:
if len(scheme_exist) == 0:
pass
elif scheme_new not in scheme_exist:
pass
else:
cmd = ce_aaa_server.delete_accounting_scheme(
module=module,
acct_scheme_name=acct_scheme_name,
accounting_mode=accounting_mode)
updates.append(cmd)
changed = True

# absent accounting domain
if domain_name:
else:
domain_exist = ce_aaa_server.get_accounting_domain(
module=module)
domain_new = (domain_name.lower(), acct_scheme_name.lower())
Expand Down

0 comments on commit c2e7683

Please sign in to comment.