diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-26 10:52:59 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-26 10:52:59 +0200 |
commit | 07f2b18a8a3de0e1af38a1db7358a1a2f0869377 (patch) | |
tree | 1ee945e5dbfe2b42c6dcf4690467a7ac6f41d4e7 /src/conf_mode/salt-minion.py | |
parent | 2102c7c318ef02f3506a8d3003ed1d41a04b190e (diff) | |
download | vyos-1x-07f2b18a8a3de0e1af38a1db7358a1a2f0869377.tar.gz vyos-1x-07f2b18a8a3de0e1af38a1db7358a1a2f0869377.zip |
salt: T2382: migrate get_config() to list items
Diffstat (limited to 'src/conf_mode/salt-minion.py')
-rwxr-xr-x | src/conf_mode/salt-minion.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/conf_mode/salt-minion.py b/src/conf_mode/salt-minion.py index 55139dca1..c0c7c3080 100755 --- a/src/conf_mode/salt-minion.py +++ b/src/conf_mode/salt-minion.py @@ -43,36 +43,36 @@ default_config_data = { def get_config(): salt = deepcopy(default_config_data) conf = Config() - if not conf.exists('service salt-minion'): + base = ['service', 'salt-minion'] + + if not conf.exists(base): return None else: - conf.set_level('service salt-minion') + conf.set_level(base) - if conf.exists('hash_type'): - salt['hash_type'] = conf.return_value('hash_type') + if conf.exists(['hash_type']): + salt['hash_type'] = conf.return_value(['hash_type']) - if conf.exists('log_file'): - salt['log_file'] = conf.return_value('log_file') + if conf.exists(['log_file']): + salt['log_file'] = conf.return_value(['log_file']) - if conf.exists('log_level'): - salt['log_level'] = conf.return_value('log_level') + if conf.exists(['log_level']): + salt['log_level'] = conf.return_value(['log_level']) - if conf.exists('master'): - master = conf.return_values('master') - salt['master'] = master + if conf.exists(['master']): + salt['master'] = conf.return_values(['master']) - if conf.exists('id'): - salt['salt_id'] = conf.return_value('id') + if conf.exists(['id']): + salt['salt_id'] = conf.return_value(['id']) - if conf.exists('user'): - salt['user'] = conf.return_value('user') + if conf.exists(['user']): + salt['user'] = conf.return_value(['user']) - if conf.exists('mine_interval'): - salt['mine_interval'] = conf.return_value('mine_interval') + if conf.exists(['mine_interval']): + salt['mine_interval'] = conf.return_value(['mine_interval']) - salt['master-key'] = None - if conf.exists('master-key'): - salt['master-key'] = conf.return_value('master-key') + if conf.exists(['master-key']): + salt['master_key'] = conf.return_value(['master-key']) salt['verify_master_pubkey_sign'] = 'true' return salt |