def test_base(self): 'check direct call ``ext_pillar()`` interface' git_pillar.__opts__['environment'] = None mypillar = git_pillar.ext_pillar('myminion', self.conf_line, {}) self.assertEqual(PILLAR_CONTENT, mypillar)
def test_base(self): 'check direct call ``ext_pillar()`` interface' with patch.dict(git_pillar.__opts__, {'environment': None}): mypillar = git_pillar.ext_pillar('myminion', self.conf_line, {}) self.assertEqual(PILLAR_CONTENT, mypillar)
def get_pillar(self, ext_pillar_conf): ''' Run git_pillar with the specified configuration ''' cachedir = tempfile.mkdtemp(dir=TMP) self.addCleanup(shutil.rmtree, cachedir, ignore_errors=True) ext_pillar_opts = salt.utils.yaml.safe_load( ext_pillar_conf.format(cachedir=cachedir, extmods=os.path.join(cachedir, 'extmods'), **self.ext_opts)) with patch.dict(git_pillar.__opts__, ext_pillar_opts): return git_pillar.ext_pillar( 'minion', {}, *ext_pillar_opts['ext_pillar'][0]['git'])
def get_pillar(self, ext_pillar_conf): """ Run git_pillar with the specified configuration """ cachedir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP) self.addCleanup(shutil.rmtree, cachedir, ignore_errors=True) ext_pillar_opts = {"optimization_order": [0, 1, 2]} ext_pillar_opts.update( salt.utils.yaml.safe_load( ext_pillar_conf.format(cachedir=cachedir, extmods=os.path.join( cachedir, "extmods"), **self.ext_opts))) with patch.dict(git_pillar.__opts__, ext_pillar_opts): return git_pillar.ext_pillar( "minion", {}, *ext_pillar_opts["ext_pillar"][0]["git"])