Rename on_demand_pillar to on_demand_ext_pillar

This commit is contained in:
Erik Johnson 2017-01-25 15:08:57 -06:00
parent d216f90c63
commit 6b014e53fc
6 changed files with 25 additions and 27 deletions

View file

@ -666,7 +666,7 @@
#ext_pillar_first: False
# The external pillars permitted to be used on-demand using pillar.ext
#on_demand_pillar:
#on_demand_ext_pillar:
# - libvirt
# - virtkey

View file

@ -2282,10 +2282,10 @@ configuration is the same as :conf_master:`file_roots`:
prod:
- /srv/pillar/prod
.. conf_master:: on_demand_pillar
.. conf_master:: on_demand_ext_pillar
``on_demand_pillar``
--------------------
``on_demand_ext_pillar``
------------------------
.. versionadded:: 2016.3.6,2016.11.3,Nitrogen
@ -2296,7 +2296,7 @@ The external pillars permitted to be used on-demand using :py:func:`pillar.ext
.. code-block:: yaml
on_demand_pillar:
on_demand_ext_pillar:
- libvirt
- virtkey
- git

View file

@ -1454,10 +1454,10 @@ the pillar environments.
prod:
- /srv/pillar/prod
.. conf_minion:: on_demand_pillar
.. conf_minion:: on_demand_ext_pillar
``on_demand_pillar``
--------------------
``on_demand_ext_pillar``
------------------------
.. versionadded:: 2016.3.6,2016.11.3,Nitrogen
@ -1469,7 +1469,7 @@ external pillars are permitted to be used on-demand using :py:func:`pillar.ext
.. code-block:: yaml
on_demand_pillar:
on_demand_ext_pillar:
- libvirt
- virtkey
- git

View file

@ -238,7 +238,7 @@ VALID_OPTS = {
'pillar_roots': dict,
# The external pillars permitted to be used on-demand using pillar.ext
'on_demand_pillar': list,
'on_demand_ext_pillar': list,
# The type of hashing algorithm to use when doing file comparisons
'hash_type': str,
@ -941,7 +941,7 @@ DEFAULT_MINION_OPTS = {
'base': [salt.syspaths.BASE_PILLAR_ROOTS_DIR,
salt.syspaths.SPM_PILLAR_PATH]
},
'on_demand_pillar': ['libvirt', 'virtkey'],
'on_demand_ext_pillar': ['libvirt', 'virtkey'],
'git_pillar_base': 'master',
'git_pillar_branch': 'master',
'git_pillar_env': '',
@ -1115,7 +1115,7 @@ DEFAULT_MASTER_OPTS = {
'base': [salt.syspaths.BASE_PILLAR_ROOTS_DIR,
salt.syspaths.SPM_PILLAR_PATH]
},
'on_demand_pillar': ['libvirt', 'virtkey'],
'on_demand_ext_pillar': ['libvirt', 'virtkey'],
'thorium_interval': 0.5,
'thorium_roots': {
'base': [salt.syspaths.BASE_THORIUM_ROOTS_DIR],

View file

@ -306,8 +306,8 @@ def ext(external, pillar=None):
'''
.. versionchanged:: 2016.3.6,2016.11.3,Nitrogen
The supported ext_pillar types are now tunable using the
:conf_master:`on_demand_pillar` config option. Earlier releases used a
hard-coded default.
:conf_master:`on_demand_ext_pillar` config option. Earlier releases
used a hard-coded default.
Generate the pillar and apply an explicit external pillar

View file

@ -318,7 +318,7 @@ class Pillar(object):
else:
log.error('Pillar data must be a dictionary')
def __valid_on_demand_pillar(self, opts):
def __valid_on_demand_ext_pillar(self, opts):
'''
Check to see if the on demand external pillar is allowed
'''
@ -329,27 +329,25 @@ class Pillar(object):
)
return False
on_demand_pillar = opts.get('on_demand_pillar', [])
on_demand = opts.get('on_demand_ext_pillar', [])
try:
invalid_on_demand_pillar = set([
x for x in self.ext if x not in on_demand_pillar
])
invalid_on_demand = set([x for x in self.ext if x not in on_demand])
except TypeError:
# Prevent traceback when on_demand_pillar option is malformed
# Prevent traceback when on_demand_ext_pillar option is malformed
log.error(
'The on_demand_pillar configuration option is malformed, it '
'should be a list of ext_pillar module names'
'The \'on_demand_ext_pillar\' configuration option is '
'malformed, it should be a list of ext_pillar module names'
)
return False
if invalid_on_demand_pillar:
if invalid_on_demand:
log.error(
'The following ext_pillar modules are not allowed for '
'on-demand pillar data: %s. Valid on-demand ext_pillar '
'modules are: %s. The valid modules can be adjusted by '
'setting the \'on_demand_pillar\' config option.',
', '.join(sorted(invalid_on_demand_pillar)),
', '.join(on_demand_pillar),
'setting the \'on_demand_ext_pillar\' config option.',
', '.join(sorted(invalid_on_demand)),
', '.join(on_demand),
)
return False
return True
@ -385,7 +383,7 @@ class Pillar(object):
opts['state_top'] = salt.utils.url.create(opts['state_top'][1:])
else:
opts['state_top'] = salt.utils.url.create(opts['state_top'])
if self.ext and self.__valid_on_demand_pillar(opts):
if self.ext and self.__valid_on_demand_ext_pillar(opts):
if 'ext_pillar' in opts:
opts['ext_pillar'].append(self.ext)
else: