diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-15 21:36:53 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-15 21:36:53 +0200 |
commit | c2b54ed6d1dc49a908e77d5fd96a2f4e2e01f887 (patch) | |
tree | 6de7fb19f7be9c15c10ba048ecf2f707bc82ea04 | |
parent | 0ea1574b922ed30b46717620ce212af7f70ec03f (diff) | |
download | vyos-1x-c2b54ed6d1dc49a908e77d5fd96a2f4e2e01f887.tar.gz vyos-1x-c2b54ed6d1dc49a908e77d5fd96a2f4e2e01f887.zip |
salt-minion: T4364: add source-interface CLI option support
-rw-r--r-- | data/templates/salt-minion/minion.j2 | 2 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_service_salt.py | 5 | ||||
-rwxr-xr-x | src/conf_mode/salt-minion.py | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/data/templates/salt-minion/minion.j2 b/data/templates/salt-minion/minion.j2 index 6940c0cde..f4001db64 100644 --- a/data/templates/salt-minion/minion.j2 +++ b/data/templates/salt-minion/minion.j2 @@ -59,7 +59,7 @@ mine_interval: {{ interval }} {% if source_interface is vyos_defined %} # The name of the interface to use when establishing the connection to the Master. -source_interface_name = {{ source_interface }} +source_interface_name: {{ source_interface }} {% endif %} # Enables verification of the master-public-signature returned by the master diff --git a/smoketest/scripts/cli/test_service_salt.py b/smoketest/scripts/cli/test_service_salt.py index 8a8ad093c..e42aa00a8 100755 --- a/smoketest/scripts/cli/test_service_salt.py +++ b/smoketest/scripts/cli/test_service_salt.py @@ -74,7 +74,7 @@ class TestServiceSALT(VyOSUnitTestSHIM.TestCase): self.cli_set(base_path + ['hash', hash]) self.cli_set(base_path + ['id', id]) self.cli_set(base_path + ['interval', interval]) - self.cli_set(base_path + ['source_interface', interface]) + self.cli_set(base_path + ['source-interface', interface]) self.cli_commit() @@ -86,8 +86,7 @@ class TestServiceSALT(VyOSUnitTestSHIM.TestCase): self.assertIn(f'hash_type: {hash}', conf) self.assertIn(f'id: {id}', conf) self.assertIn(f'mine_interval: {interval}', conf) - self.assertIn(f'id: {interface}', conf) - self.assertIn(f'source_interface_name: {id}', conf) + self.assertIn(f'source_interface_name: {interface}', conf) if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/src/conf_mode/salt-minion.py b/src/conf_mode/salt-minion.py index d296bc202..ea2214b98 100755 --- a/src/conf_mode/salt-minion.py +++ b/src/conf_mode/salt-minion.py @@ -22,10 +22,10 @@ from urllib3 import PoolManager from vyos.config import Config from vyos.configdict import dict_merge +from vyos.configverify import verify_interface_exists from vyos.template import render from vyos.util import call from vyos.util import chown -from vyos.verify import verify_interface_exists from vyos.xml import defaults from vyos import ConfigError |