mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge branch '2014.7' of https://github.com/saltstack/salt into fix_user_present
This commit is contained in:
commit
731e7af3dd
@ -51,8 +51,9 @@ Var MinionName_State
|
||||
Page custom nsDialogsPage nsDialogsPageLeave
|
||||
; Instfiles page
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
; Finish page
|
||||
!define MUI_FINISHPAGE_RUN "sc"
|
||||
!define MUI_FINISHPAGE_RUN "net"
|
||||
!define MUI_FINISHPAGE_RUN_PARAMETERS "start salt-minion"
|
||||
!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}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||
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
|
||||
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
|
||||
HideWindow
|
||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK
|
||||
|
@ -215,7 +215,9 @@ def reap_fileserver_cache_dir(cache_base, find_func):
|
||||
# This will only remove the directory on the second time
|
||||
# "_reap_cache" is called (which is intentional)
|
||||
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
|
||||
# if not, lets check the files in the directory
|
||||
for file_ in files:
|
||||
|
@ -1069,7 +1069,13 @@ class Loader(object):
|
||||
end, module_name)
|
||||
log.warning(msg)
|
||||
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
|
||||
virtualname = getattr(mod, '__virtualname__', virtual)
|
||||
if not virtual:
|
||||
|
@ -711,6 +711,10 @@ class Minion(MinionBase):
|
||||
' {0}'.format(opts['master']))
|
||||
if opts['master_shuffle']:
|
||||
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':
|
||||
log.info('Syndic setting master_syndic to \'{0}\''.format(opts['master']))
|
||||
|
||||
|
@ -495,6 +495,13 @@ def get_or_set_hash(name,
|
||||
.. code-block:: bash
|
||||
|
||||
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)
|
||||
|
||||
|
@ -214,7 +214,8 @@ class Pillar(object):
|
||||
),
|
||||
self.rend,
|
||||
self.opts['renderer'],
|
||||
self.opts['environment']
|
||||
self.opts['environment'],
|
||||
_pillar_rend=True
|
||||
)
|
||||
]
|
||||
else:
|
||||
@ -227,7 +228,8 @@ class Pillar(object):
|
||||
),
|
||||
self.rend,
|
||||
self.opts['renderer'],
|
||||
saltenv=saltenv
|
||||
saltenv=saltenv,
|
||||
_pillar_rend=True
|
||||
)
|
||||
)
|
||||
except Exception as exc:
|
||||
@ -262,7 +264,8 @@ class Pillar(object):
|
||||
).get('dest', False),
|
||||
self.rend,
|
||||
self.opts['renderer'],
|
||||
saltenv=saltenv
|
||||
saltenv=saltenv,
|
||||
_pillar_rend=True
|
||||
)
|
||||
)
|
||||
except Exception as exc:
|
||||
|
@ -332,6 +332,7 @@ def _gen_keep_files(name, require):
|
||||
ret = set()
|
||||
if os.path.isdir(name):
|
||||
for root, dirs, files in os.walk(name):
|
||||
ret.add(name)
|
||||
for name in files:
|
||||
ret.add(os.path.join(root, name))
|
||||
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]
|
||||
for comp in required_files:
|
||||
for low in __lowstate__:
|
||||
if low['__id__'] == comp['file']:
|
||||
if low['name'] == comp['file']:
|
||||
fn = low['name']
|
||||
if os.path.isdir(comp['file']):
|
||||
if _is_child(comp['file'], name):
|
||||
|
@ -17,10 +17,12 @@ def __virtual__():
|
||||
'''
|
||||
Load this state if this is the salt-master
|
||||
'''
|
||||
|
||||
return ('winrepo'
|
||||
if 'salt-master' in __grains__.get('roles', [])
|
||||
else False)
|
||||
try:
|
||||
return ('winrepo'
|
||||
if 'salt-master' in __grains__.get('roles', [])
|
||||
else False)
|
||||
except TypeError:
|
||||
return False
|
||||
|
||||
|
||||
def genrepo(name, force=False, allow_empty=False):
|
||||
|
Loading…
Reference in New Issue
Block a user