Merge branch '2014.7' of https://github.com/saltstack/salt into fix_user_present

This commit is contained in:
salt_build 2015-05-13 17:13:05 +00:00
commit 731e7af3dd
8 changed files with 41 additions and 17 deletions

View File

@ -51,8 +51,9 @@ Var MinionName_State
Page custom nsDialogsPage nsDialogsPageLeave Page custom nsDialogsPage nsDialogsPageLeave
; Instfiles page ; Instfiles page
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
; Finish page ; Finish page
!define MUI_FINISHPAGE_RUN "sc" !define MUI_FINISHPAGE_RUN "net"
!define MUI_FINISHPAGE_RUN_PARAMETERS "start salt-minion" !define MUI_FINISHPAGE_RUN_PARAMETERS "start salt-minion"
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
@ -245,15 +246,13 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
WriteRegStr HKLM "SYSTEM\CurrentControlSet\services\salt-minion" "DependOnService" "nsi" WriteRegStr HKLM "SYSTEM\CurrentControlSet\services\salt-minion" "DependOnService" "nsi"
ExecWait "nssm.exe install salt-minion $INSTDIR\bin\python.exe $INSTDIR\bin\Scripts\salt-minion -c $INSTDIR\conf -l quiet"
RMDir /R "$INSTDIR\var\cache\salt" ; removing cache from old version
Call updateMinionConfig Call updateMinionConfig
SectionEnd SectionEnd
Function .onInstSuccess
Exec "nssm.exe install salt-minion $INSTDIR\bin\python.exe $INSTDIR\bin\Scripts\salt-minion -c $INSTDIR\conf -l quiet"
RMDir /R "$INSTDIR\var\cache\salt" ; removing cache from old version
ExecWait "net start salt-minion"
FunctionEnd
Function un.onUninstSuccess Function un.onUninstSuccess
HideWindow HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK

View File

@ -215,7 +215,9 @@ def reap_fileserver_cache_dir(cache_base, find_func):
# This will only remove the directory on the second time # This will only remove the directory on the second time
# "_reap_cache" is called (which is intentional) # "_reap_cache" is called (which is intentional)
if len(dirs) == 0 and len(files) == 0: if len(dirs) == 0 and len(files) == 0:
os.rmdir(root) # only remove if empty directory is older than 60s
if time.time() - os.path.getctime(root) > 60:
os.rmdir(root)
continue continue
# if not, lets check the files in the directory # if not, lets check the files in the directory
for file_ in files: for file_ in files:

View File

@ -1069,7 +1069,13 @@ class Loader(object):
end, module_name) end, module_name)
log.warning(msg) log.warning(msg)
else: else:
virtual = mod.__virtual__() try:
virtual = mod.__virtual__()
except Exception as exc:
log.error('Exception raised when processing __virtual__ function'
' for {0}. Module will not be loaded {1}'.format(
module_name, exc))
virtual = None
# Get the module's virtual name # Get the module's virtual name
virtualname = getattr(mod, '__virtualname__', virtual) virtualname = getattr(mod, '__virtualname__', virtual)
if not virtual: if not virtual:

View File

@ -711,6 +711,10 @@ class Minion(MinionBase):
' {0}'.format(opts['master'])) ' {0}'.format(opts['master']))
if opts['master_shuffle']: if opts['master_shuffle']:
shuffle(opts['master']) shuffle(opts['master'])
elif isinstance(opts['master'], str):
# We have a string, but a list was what was intended. Convert.
# See issue 23611 for details
opts['master'] = list(opts['master'])
elif opts['__role'] == 'syndic': elif opts['__role'] == 'syndic':
log.info('Syndic setting master_syndic to \'{0}\''.format(opts['master'])) log.info('Syndic setting master_syndic to \'{0}\''.format(opts['master']))

View File

@ -495,6 +495,13 @@ def get_or_set_hash(name,
.. code-block:: bash .. code-block:: bash
salt '*' grains.get_or_set_hash 'django:SECRET_KEY' 50 salt '*' grains.get_or_set_hash 'django:SECRET_KEY' 50
.. warning::
This function could return strings which may contain characters which are reserved
as directives by the YAML parser, such as strings beginning with `%`. To avoid
issues when using the output of this function in an SLS file containing YAML+Jinja,
surround the call with single quotes.
''' '''
ret = get(name, None) ret = get(name, None)

View File

@ -214,7 +214,8 @@ class Pillar(object):
), ),
self.rend, self.rend,
self.opts['renderer'], self.opts['renderer'],
self.opts['environment'] self.opts['environment'],
_pillar_rend=True
) )
] ]
else: else:
@ -227,7 +228,8 @@ class Pillar(object):
), ),
self.rend, self.rend,
self.opts['renderer'], self.opts['renderer'],
saltenv=saltenv saltenv=saltenv,
_pillar_rend=True
) )
) )
except Exception as exc: except Exception as exc:
@ -262,7 +264,8 @@ class Pillar(object):
).get('dest', False), ).get('dest', False),
self.rend, self.rend,
self.opts['renderer'], self.opts['renderer'],
saltenv=saltenv saltenv=saltenv,
_pillar_rend=True
) )
) )
except Exception as exc: except Exception as exc:

View File

@ -332,6 +332,7 @@ def _gen_keep_files(name, require):
ret = set() ret = set()
if os.path.isdir(name): if os.path.isdir(name):
for root, dirs, files in os.walk(name): for root, dirs, files in os.walk(name):
ret.add(name)
for name in files: for name in files:
ret.add(os.path.join(root, name)) ret.add(os.path.join(root, name))
for name in dirs: for name in dirs:
@ -343,7 +344,7 @@ def _gen_keep_files(name, require):
required_files = [comp for comp in require if 'file' in comp] required_files = [comp for comp in require if 'file' in comp]
for comp in required_files: for comp in required_files:
for low in __lowstate__: for low in __lowstate__:
if low['__id__'] == comp['file']: if low['name'] == comp['file']:
fn = low['name'] fn = low['name']
if os.path.isdir(comp['file']): if os.path.isdir(comp['file']):
if _is_child(comp['file'], name): if _is_child(comp['file'], name):

View File

@ -17,10 +17,12 @@ def __virtual__():
''' '''
Load this state if this is the salt-master Load this state if this is the salt-master
''' '''
try:
return ('winrepo' return ('winrepo'
if 'salt-master' in __grains__.get('roles', []) if 'salt-master' in __grains__.get('roles', [])
else False) else False)
except TypeError:
return False
def genrepo(name, force=False, allow_empty=False): def genrepo(name, force=False, allow_empty=False):