#NEWLINE# def lock( backend = None , remote = None ) : #NEWLINE# #INDENT# "\n    .. versionadded:: 2015.5.0\n\n    Set a fileserver update lock for VCS fileserver backends (:mod:`git\n    <salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn\n    <salt.fileserver.svnfs>`).\n\n    .. note::\n\n        This will only operate on enabled backends (those configured in\n        :conf_master:`fileserver_backend`).\n\n    backend\n        Only set the update lock for the specified backend(s).\n\n    remote\n        If not None, then any remotes which contain the passed string will have\n        their lock cleared. For example, a ``remote`` value of ``*github.com*``\n        will remove the lock from all github.com remotes.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt-run fileserver.lock\n        salt-run fileserver.lock backend=git,hg\n        salt-run fileserver.lock backend=git remote='*github.com*'\n        salt-run fileserver.lock remote=bitbucket\n    " #NEWLINE# fileserver = salt . fileserver . Fileserver ( __opts__ ) #NEWLINE# ( locked , errors ) = fileserver . lock ( back = backend , remote = remote ) #NEWLINE# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if locked : #NEWLINE# #INDENT# ret [ 'locked' ] = locked #NEWLINE# #UNINDENT# if errors : #NEWLINE# #INDENT# ret [ 'errors' ] = errors #NEWLINE# #UNINDENT# if ( not ret ) : #NEWLINE# #INDENT# return 'No locks were set' #NEWLINE# #UNINDENT# return ret