Fix pillar unit test failures: file_roots and pillar_roots environments should be lists

This commit is contained in:
rallytime 2018-03-20 17:32:21 -04:00
parent fe2d46dd0c
commit 46ba72fb1c
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -302,13 +302,13 @@ class PillarTestCase(TestCase):
'renderer_blacklist': [],
'renderer_whitelist': [],
'state_top': '',
'pillar_roots': {'__env__': '/srv/pillar/__env__', 'base': '/srv/pillar/base'},
'file_roots': {'base': '/srv/salt/base', 'dev': '/svr/salt/dev'},
'pillar_roots': {'__env__': ['/srv/pillar/__env__'], 'base': ['/srv/pillar/base']},
'file_roots': {'base': ['/srv/salt/base'], 'dev': ['/svr/salt/dev']},
'extension_modules': '',
}
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='dev')
self.assertEqual(pillar.opts['file_roots'],
{'base': '/srv/pillar/base', 'dev': '/srv/pillar/__env__'})
{'base': ['/srv/pillar/base'], 'dev': ['/srv/pillar/__env__']})
def test_ignored_dynamic_pillarenv(self):
opts = {
@ -316,12 +316,12 @@ class PillarTestCase(TestCase):
'renderer_blacklist': [],
'renderer_whitelist': [],
'state_top': '',
'pillar_roots': {'__env__': '/srv/pillar/__env__', 'base': '/srv/pillar/base'},
'file_roots': {'base': '/srv/salt/base', 'dev': '/svr/salt/dev'},
'pillar_roots': {'__env__': ['/srv/pillar/__env__'], 'base': ['/srv/pillar/base']},
'file_roots': {'base': ['/srv/salt/base'], 'dev': ['/svr/salt/dev']},
'extension_modules': '',
}
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='base')
self.assertEqual(pillar.opts['file_roots'], {'base': '/srv/pillar/base'})
self.assertEqual(pillar.opts['file_roots'], {'base': ['/srv/pillar/base']})
def test_malformed_pillar_sls(self):
with patch('salt.pillar.compile_template') as compile_template: