mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
salt.fileserver: Add ability to clear checkout locks
This commit is contained in:
parent
af410d8dd1
commit
155b84b88a
1 changed files with 6 additions and 4 deletions
|
@ -272,7 +272,7 @@ def is_file_ignored(opts, fname):
|
|||
return False
|
||||
|
||||
|
||||
def clear_lock(clear_func, lock_type, remote=None):
|
||||
def clear_lock(clear_func, role, remote=None, lock_type='update'):
|
||||
'''
|
||||
Function to allow non-fileserver functions to clear update locks
|
||||
|
||||
|
@ -282,7 +282,7 @@ def clear_lock(clear_func, lock_type, remote=None):
|
|||
lists, one containing messages describing successfully cleared locks,
|
||||
and one containing messages describing errors encountered.
|
||||
|
||||
lock_type
|
||||
role
|
||||
What type of lock is being cleared (gitfs, git_pillar, etc.). Used
|
||||
solely for logging purposes.
|
||||
|
||||
|
@ -290,14 +290,16 @@ def clear_lock(clear_func, lock_type, remote=None):
|
|||
Optional string which should be used in ``func`` to pattern match so
|
||||
that a subset of remotes can be targeted.
|
||||
|
||||
lock_type : update
|
||||
Which type of lock to clear
|
||||
|
||||
Returns the return data from ``clear_func``.
|
||||
'''
|
||||
msg = 'Clearing update lock for {0} remotes'.format(lock_type)
|
||||
msg = 'Clearing {0} lock for {1} remotes'.format(lock_type, role)
|
||||
if remote:
|
||||
msg += ' matching {0}'.format(remote)
|
||||
log.debug(msg)
|
||||
return clear_func(remote=remote)
|
||||
return clear_func(remote=remote, lock_type=lock_type)
|
||||
|
||||
|
||||
class Fileserver(object):
|
||||
|
|
Loading…
Add table
Reference in a new issue