Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
wen587 committed Feb 28, 2024
1 parent 7a4e3c3 commit 046079e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2010,11 +2010,11 @@ def aaa_table_hard_dependency_check(config_json):
AAA_TABLE = config_json.get("AAA", {})
TACPLUS_TABLE = config_json.get("TACPLUS", {})

aaa_authorization_login = AAA_TABLE.get("authorization", {}).get("login", "")
tacacs_enable = "tacacs+" in aaa_authorization_login.split(",")
aaa_authentication_login = AAA_TABLE.get("authentication", {}).get("login", "")
tacacs_enable = "tacacs+" in aaa_authentication_login.split(",")
tacplus_passkey = TACPLUS_TABLE.get("global", {}).get("passkey", "")
if tacacs_enable and len(tacplus_passkey) == 0:
click.secho("Authorization with 'tacacs+' is not allowed when passkey not exits.", fg="magenta")
click.secho("Authentication with 'tacacs+' is not allowed when passkey not exits.", fg="magenta")
sys.exit(1)


Expand Down
4 changes: 2 additions & 2 deletions tests/config_override_input/aaa_yang_hard_check.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"running_config": {
"AAA": {
"authorization": {
"authentication": {
"login": "tacacs+"
}
},
Expand All @@ -15,7 +15,7 @@
},
"expected_config": {
"AAA": {
"authorization": {
"authentication": {
"login": "tacacs+"
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/config_override_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def read_json_file_side_effect(filename):
['golden_config_db.json'], obj=db)

assert result.exit_code != 0
assert "Authorization with 'tacacs+' is not allowed when passkey not exits." in result.output
assert "Authentication with 'tacacs+' is not allowed when passkey not exits." in result.output

def check_override_config_table(self, db, config, running_config,
golden_config, expected_config):
Expand Down

0 comments on commit 046079e

Please sign in to comment.