Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Art Schneider 2017-06-08 14:33:33 -06:00
commit 3c2a7ae6d6
11 changed files with 294 additions and 29 deletions

View File

@ -194,6 +194,7 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or
guestinfo.foo: bar
guestinfo.domain: foobar.com
guestinfo.customVariable: customValue
annotation: Created by Salt-Cloud
deploy: True
customization: True
@ -451,6 +452,11 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or
present, it will be reset with the new value provided. Otherwise, a new option is
added. Keys with empty values will be removed.
``annotation``
User-provided description of the virtual machine. This will store a message in the
vSphere interface, under the annotations section in the Summary view of the virtual
machine.
``deploy``
Specifies if salt should be installed on the newly created VM. Default is ``True``
so salt will be installed using the bootstrap script. If ``template: True`` or

View File

@ -2863,6 +2863,8 @@ def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True):
volume_dict['iops'] = volume['iops']
if 'encrypted' in volume:
volume_dict['encrypted'] = volume['encrypted']
if 'kmskeyid' in volume:
volume_dict['kmskeyid'] = volume['kmskeyid']
if 'volume_id' not in volume_dict:
created_volume = create_volume(volume_dict, call='function', wait_to_finish=wait_to_finish)
@ -4059,6 +4061,13 @@ def create_volume(kwargs=None, call=None, wait_to_finish=False):
# You can't set `encrypted` if you pass a snapshot
if 'encrypted' in kwargs and 'snapshot' not in kwargs:
params['Encrypted'] = kwargs['encrypted']
if 'kmskeyid' in kwargs:
params['KmsKeyId'] = kwargs['kmskeyid']
if 'kmskeyid' in kwargs and 'encrypted' not in kwargs:
log.error(
'If a KMS Key ID is specified, encryption must be enabled'
)
return False
log.debug(params)

View File

@ -2359,6 +2359,9 @@ def create(vm_):
extra_config = config.get_cloud_config_value(
'extra_config', vm_, __opts__, default=None
)
annotation = config.get_cloud_config_value(
'annotation', vm_, __opts__, default=None
)
power = config.get_cloud_config_value(
'power_on', vm_, __opts__, default=True
)
@ -2569,6 +2572,9 @@ def create(vm_):
option = vim.option.OptionValue(key=key, value=value)
config_spec.extraConfig.append(option)
if annotation:
config_spec.annotation = str(annotation)
if 'clonefrom' in vm_:
clone_spec = handle_snapshot(
config_spec,

View File

@ -2058,7 +2058,9 @@ def include_config(include, orig_path, verbose, exit_on_config_errors=False):
else:
# Initialize default config if we wish to skip config errors
opts = {}
schedule = opts.get('schedule', {})
if schedule and 'schedule' in configuration:
configuration['schedule'].update(schedule)
include = opts.get('include', [])
if include:
opts.update(include_config(include, fn_, verbose))

View File

@ -6,6 +6,7 @@ Render the pillar data
# Import python libs
from __future__ import absolute_import
import copy
import fnmatch
import os
import collections
import logging
@ -289,6 +290,7 @@ class Pillar(object):
self.opts = self.__gen_opts(opts, grains, saltenv=saltenv, pillarenv=pillarenv)
self.saltenv = saltenv
self.client = salt.fileclient.get_file_client(self.opts, True)
self.avail = self.__gather_avail()
if opts.get('file_client', '') == 'local':
opts['grains'] = grains
@ -359,6 +361,15 @@ class Pillar(object):
return False
return True
def __gather_avail(self):
'''
Gather the lists of available sls data from the master
'''
avail = {}
for saltenv in self._get_envs():
avail[saltenv] = self.client.list_states(saltenv)
return avail
def __gen_opts(self, opts_in, grains, saltenv=None, ext=None, pillarenv=None):
'''
The options need to be altered to conform to the file client
@ -722,8 +733,23 @@ class Pillar(object):
if errors is None:
errors = []
for saltenv, pstates in six.iteritems(matches):
pstatefiles = []
mods = set()
for sls in pstates:
for sls_match in pstates:
matched_pstates = []
try:
matched_pstates = fnmatch.filter(self.avail[saltenv], sls_match)
except KeyError:
errors.extend(
['No matching pillar environment for environment '
'\'{0}\' found'.format(saltenv)]
)
if matched_pstates:
pstatefiles.extend(matched_pstates)
else:
pstatefiles.append(sls_match)
for sls in pstatefiles:
pstate, mods, err = self.render_pstate(sls, saltenv, mods)
if err:

View File

@ -6,7 +6,7 @@ A module that adds data to the Pillar structure retrieved by an http request
Configuring the HTTP_JSON ext_pillar
====================================
Set the following Salt config to setup Foreman as external pillar source:
Set the following Salt config to setup http json result as external pillar source:
.. code-block:: yaml
@ -17,6 +17,16 @@ Set the following Salt config to setup Foreman as external pillar source:
username: username
password: password
If the with_grains parameter is set, grain keys wrapped in can be provided (wrapped
in <> brackets) in the url in order to populate pillar data based on the grain value.
.. code-block:: yaml
ext_pillar:
- http_json:
url: http://example.com/api/<nodename>
with_grains: True
Module Documentation
====================
'''
@ -24,32 +34,61 @@ Module Documentation
# Import python libs
from __future__ import absolute_import
import logging
import re
# Import Salt libs
import salt.ext.six as six
try:
from salt.ext.six.moves.urllib.parse import quote as _quote
_HAS_DEPENDENCIES = True
except ImportError:
_HAS_DEPENDENCIES = False
# Set up logging
_LOG = logging.getLogger(__name__)
def __virtual__():
return _HAS_DEPENDENCIES
def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url=None):
url,
with_grains=False):
'''
Read pillar data from HTTP response.
:param url String to make request
:returns dict with pillar data to add
:returns empty if error
'''
# Set up logging
log = logging.getLogger(__name__)
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:return: A dictionary of the pillar data to add.
:rtype: dict
'''
grain_pattern = r'<(?P<grain_name>.*?)>'
if with_grains:
# Get the value of the grain and substitute each grain
# name for the url-encoded version of its grain value.
for match in re.finditer(grain_pattern, url):
grain_name = match.group('grain_name')
grain_value = __salt__['grains.get'](grain_name, None)
if not grain_value:
_LOG.error("Unable to get minion '%s' grain: %s", minion_id, grain_name)
return {}
grain_value = _quote(str(grain_value))
url = re.sub('<{0}>'.format(grain_name), grain_value, url)
_LOG.debug('Getting url: %s', url)
data = __salt__['http.query'](url=url, decode=True, decode_type='json')
if 'dict' in data:
return data['dict']
log.error('Error caught on query to' + url + '\nMore Info:\n')
_LOG.error("Error on minion '%s' http query: %s\nMore Info:\n", minion_id, url)
for k, v in six.iteritems(data):
log.error(k + ' : ' + v)
for key in data:
_LOG.error('%s: %s', key, data[key])
return {}

View File

@ -17,6 +17,16 @@ Set the following Salt config to setup an http endpoint as the external pillar s
username: username
password: password
If the with_grains parameter is set, grain keys wrapped in can be provided (wrapped
in <> brackets) in the url in order to populate pillar data based on the grain value.
.. code-block:: yaml
ext_pillar:
- http_yaml:
url: http://example.com/api/<nodename>
with_grains: True
Module Documentation
====================
'''
@ -24,32 +34,62 @@ Module Documentation
# Import python libs
from __future__ import absolute_import
import logging
import re
# Import Salt libs
import salt.ext.six as six
try:
from salt.ext.six.moves.urllib.parse import quote as _quote
_HAS_DEPENDENCIES = True
except ImportError:
_HAS_DEPENDENCIES = False
# Set up logging
_LOG = logging.getLogger(__name__)
def __virtual__():
return _HAS_DEPENDENCIES
def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url):
"""
url,
with_grains=False):
'''
Read pillar data from HTTP response.
:param url String to make request
:returns dict with pillar data to add
:returns empty if error
"""
# Set up logging
log = logging.getLogger(__name__)
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:return: A dictionary of the pillar data to add.
:rtype: dict
'''
grain_pattern = r'<(?P<grain_name>.*?)>'
if with_grains:
# Get the value of the grain and substitute each grain
# name for the url-encoded version of its grain value.
for match in re.finditer(grain_pattern, url):
grain_name = match.group('grain_name')
grain_value = __salt__['grains.get'](grain_name, None)
if not grain_value:
_LOG.error("Unable to get minion '%s' grain: %s", minion_id, grain_name)
return {}
grain_value = _quote(str(grain_value))
url = re.sub('<{0}>'.format(grain_name), grain_value, url)
_LOG.debug('Getting url: %s', url)
data = __salt__['http.query'](url=url, decode=True, decode_type='yaml')
if 'dict' in data:
return data['dict']
log.error('Error caught on query to' + url + '\nMore Info:\n')
_LOG.error("Error on minion '%s' http query: %s\nMore Info:\n", minion_id, url)
for k, v in six.iteritems(data):
log.error(k + ' : ' + v)
for key in data:
_LOG.error('%s: %s', key, data[key])
return {}

View File

@ -72,7 +72,8 @@ def event_return(events):
try:
with salt.utils.flopen(opts['filename'], 'a') as logfile:
for event in events:
logfile.write(str(json.dumps(event))+'\n')
json.dump(event, logfile)
logfile.write('\n')
except:
log.error('Could not write to rawdata_json file {0}'.format(opts['filename']))
raise

View File

@ -131,6 +131,8 @@ class GitPythonMixin(object):
Test using a single ext_pillar repo
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -156,6 +158,8 @@ class GitPythonMixin(object):
pillar_merge_lists disabled.
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -184,6 +188,8 @@ class GitPythonMixin(object):
pillar_merge_lists disabled.
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -212,6 +218,8 @@ class GitPythonMixin(object):
pillar_merge_lists enabled.
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -240,6 +248,8 @@ class GitPythonMixin(object):
pillar_merge_lists enabled.
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -264,6 +274,8 @@ class GitPythonMixin(object):
Test using pillarenv to restrict results to those from a single branch
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -289,6 +301,8 @@ class GitPythonMixin(object):
SLS file (included_pillar) in the compiled pillar data.
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
cachedir: {cachedir}
extension_modules: {extmods}
@ -317,6 +331,8 @@ class GitPythonMixin(object):
message in the compiled data.
'''
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: gitpython
git_pillar_includes: False
cachedir: {cachedir}
@ -437,6 +453,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -450,6 +468,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -467,6 +487,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -481,6 +503,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -513,6 +537,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -528,6 +554,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -549,6 +577,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -565,6 +595,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -602,6 +634,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -617,6 +651,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -638,6 +674,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -654,6 +692,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -691,6 +731,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -706,6 +748,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -727,6 +771,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -743,6 +789,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -780,6 +828,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -795,6 +845,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -816,6 +868,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -832,6 +886,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -864,6 +920,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -879,6 +937,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -900,6 +960,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -916,6 +978,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -951,6 +1015,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_nopass}
git_pillar_privkey: {privkey_nopass}
@ -966,6 +1032,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -987,6 +1055,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_pubkey: {pubkey_withpass}
git_pillar_privkey: {privkey_withpass}
@ -1003,6 +1073,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1041,6 +1113,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
git_pillar_pubkey: {pubkey_nopass}
@ -1057,6 +1131,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphraseless key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
cachedir: {cachedir}
@ -1079,6 +1155,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
git_pillar_pubkey: {pubkey_withpass}
@ -1096,6 +1174,8 @@ class TestPygit2SSH(GitPillarSSHTestBase):
# Test with passphrase-protected key and per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
cachedir: {cachedir}
@ -1144,6 +1224,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1171,6 +1253,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1200,6 +1284,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1229,6 +1315,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1258,6 +1346,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1282,6 +1372,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1309,6 +1401,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1339,6 +1433,8 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
}
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
cachedir: {cachedir}
@ -1388,6 +1484,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1402,6 +1500,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1433,6 +1533,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1449,6 +1551,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1485,6 +1589,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1501,6 +1607,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1537,6 +1645,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1553,6 +1663,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1589,6 +1701,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1605,6 +1719,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1636,6 +1752,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1652,6 +1770,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1686,6 +1806,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_user: {user}
git_pillar_password: {password}
@ -1702,6 +1824,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
cachedir: {cachedir}
extension_modules: {extmods}
@ -1739,6 +1863,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with global credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
git_pillar_user: {user}
@ -1756,6 +1882,8 @@ class TestPygit2AuthenticatedHTTP(GitPillarHTTPTestBase):
# Test with per-repo credential options
ret = self.get_pillar('''\
file_ignore_regex: []
file_ignore_glob: []
git_pillar_provider: pygit2
git_pillar_includes: False
cachedir: {cachedir}

View File

@ -56,6 +56,8 @@ class GitPillarTestCase(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModul
'cachedir': cachedir,
'pillar_roots': {},
'hash_type': 'sha256',
'file_ignore_regex': [],
'file_ignore_glob': [],
'file_roots': {},
'state_top': 'top.sls',
'extension_modules': '',

View File

@ -37,8 +37,14 @@ class PillarTestCase(TestCase):
'renderer_blacklist': [],
'renderer_whitelist': [],
'state_top': '',
'pillar_roots': ['dev', 'base'],
'file_roots': ['dev', 'base'],
'pillar_roots': {
'dev': [],
'base': []
},
'file_roots': {
'dev': [],
'base': []
},
'extension_modules': '',
'pillarenv_from_saltenv': True
}