Commit Graph

38147 Commits

Author SHA1 Message Date
Erik Johnson
a2452aa611 gitfs: Add warning about ssh:// URLs (dulwich) 2015-02-24 22:37:30 -06:00
Erik Johnson
256786cc94 gitfs: Support ssh:// URLs for dulwich 2015-02-24 22:37:30 -06:00
Erik Johnson
852c29871f fix missing import 2015-02-24 22:37:30 -06:00
Erik Johnson
1a74097903 Fix CLI example for fileserver.clear_cache runner 2015-02-24 22:37:30 -06:00
Erik Johnson
a65302560c Lint fixes 2015-02-24 22:37:30 -06:00
Erik Johnson
e7a3142f1a Fix spurious error in master log
When only GitPython is installed, and no gitfs_provider is set, an error
about pygit2 not being available is logged. This should not happen, as
gitfs should just select the first available out of pygit2, gitpython,
and dulwich.

This fixes #17945 by suppressing the error.
2015-02-24 22:37:30 -06:00
Erik Johnson
d2c543cca9 Log success/failure in dealing with lockfiles in their actual functions
Logging them separately in update() doesn't make much sense.
2015-02-24 22:37:30 -06:00
Erik Johnson
7f968123a6 Add salt.fileserver.gitfs.lock()
Also rewrite salt.fileserver.gitfs.clear_lock() to accept a repo conf
dict instead of a pattern, so that locking and unlocking in
salt.fileserver.gitfs.update() can use the same code as the fileserver
runner.
2015-02-24 22:37:30 -06:00
Erik Johnson
2e07dc038c Add salt.fileserver.svnfs.lock()
Also rewrite salt.fileserver.svnfs.clear_lock() to accept a repo conf
dict instead of a pattern, so that locking and unlocking in
salt.fileserver.svnfs.update() can use the same code as the fileserver
runner.
2015-02-24 22:37:30 -06:00
Erik Johnson
db85cd43f7 Improve salt fileserver documentation 2015-02-24 22:37:30 -06:00
Erik Johnson
a183521f44 Add salt.runners.fileserver.lock() 2015-02-24 22:37:30 -06:00
Erik Johnson
d07e21f97b Add salt.runners.fileserver.{,empty_}dir_list
This rounds out the runner support for the fileserver runner.
2015-02-24 22:37:29 -06:00
Erik Johnson
1b7ca48e8d Add a backend argument for salt.runners.fileserver.{file,symlink}_list
This allows for backends to be excluded when executing these runners.
2015-02-24 22:37:29 -06:00
Erik Johnson
8d1214a824 Add function in Fileserver class to invoke fsb.lock 2015-02-24 22:37:29 -06:00
Erik Johnson
9550596266 Add salt.fileserver.hgfs.lock()
Also rewrite salt.fileserver.hgfs.clear_lock() to accept a repo conf
dict instead of a pattern, so that locking and unlocking in
salt.fileserver.hgfs.update() can use the same code as the fileserver
runner.
2015-02-24 22:37:29 -06:00
Erik Johnson
b488952ff3 Support fileserver backend passed in load for fileserver operations
Also support "-backend" notation to exclude a backend from a given
operation.
2015-02-24 22:37:29 -06:00
Erik Johnson
17815345f9 Use new clear_lock() function to clear update lock in update() 2015-02-24 22:37:29 -06:00
Erik Johnson
eeb0a4d7ca svnfs: Avoid 2nd init() by returning repos from _clear_old_remotes 2015-02-24 22:37:29 -06:00
Erik Johnson
28663dc5dd hgfs: Avoid 2nd init() by returning repos from _clear_old_remotes 2015-02-24 22:37:29 -06:00
Erik Johnson
8d64a41285 gitfs/hgfs/svnfs: Rewrite _clear_old_remotes()
Rather than using a subtractive approach (doing an os.listdir() and then
removing the stuff we don't want to delete), instead use an additive
approach and assemble a list of things we *do* want to delete. This
makes the function easier to read and maintain.
2015-02-24 22:37:29 -06:00
Erik Johnson
6c6021d6c1 Log an error if unexpected files are found in gitfs/hgfs/svnfs cachedir
This loop is designed to remove the cache directories from old remotes.
shutil.rmtree() will throw an OSError, however, if run on something
other than a directory. This commit catches this exception and logs it.
Seeing this error in the log will be a reminder that some new file has
been added to the cachedir to be used by the FS backend, and that it
needs to be added to the exclusion logic above.
2015-02-24 22:37:29 -06:00
Erik Johnson
1c17e3764b Move hgfs update lock out of hg checkout
Newer hglib freaks out if files that don't belong in the repo are
present. This commit moves the update lock up a level into
$cachedir/hgfs.
2015-02-24 22:37:29 -06:00
Erik Johnson
c959deefc2 Fix traceback in salt.fileserver.hgfs.init()
Older versions of hglib did not raise an exception when no refs were
found. This commit catches the exception, fixing a traceback that
prevents new remotes from ever being fetched for the first time.
2015-02-24 22:37:29 -06:00
Erik Johnson
bd42dcb5b5 Add logging noting which remote is being fetched 2015-02-24 22:37:29 -06:00
Erik Johnson
f0c27d309c Use shorter version of salt-run command in warning 2015-02-24 22:37:29 -06:00
Erik Johnson
4dc92710bd Add salt.fileserver.svnfs.clear_lock() 2015-02-24 22:37:29 -06:00
Erik Johnson
7c3788dd54 Add salt.fileserver.hgfs.clear_lock() 2015-02-24 22:37:28 -06:00
Erik Johnson
15a9e8421d Allow "fs" versions of VCS backends to work as arguments to fileserver runner functions
i.e. "gitfs" and "git" both work, "hgfs" and "hg", etc. This should help
reduce confusion.
2015-02-24 22:37:28 -06:00
Erik Johnson
74a6737e58 fix broken salt.utils.is_fcntl_available 2015-02-24 22:37:28 -06:00
Erik Johnson
ce3680249c add fileserver.clear_lock runner 2015-02-24 22:37:28 -06:00
Erik Johnson
6de88fc819 Add function in Fileserver class to invoke fsb.clear_lock 2015-02-24 22:37:28 -06:00
Erik Johnson
19f52b07ef Add salt.fileserver.gitfs.clear_lock() 2015-02-24 22:37:28 -06:00
Erik Johnson
7c3bb8bf5a Revert file locking code from PR #20141 2015-02-24 22:37:28 -06:00
Erik Johnson
61cfed60a1 Add example of clearing gitfs cache pre-2015.2.0 2015-02-24 22:37:28 -06:00
Erik Johnson
5bb28b6969 Add note about dulwich gitfs cache incompatibility 2015-02-24 22:37:28 -06:00
Erik Johnson
96d4151ecd runners.fileserver.clear_cache: display success and errors separately 2015-02-24 22:37:28 -06:00
Erik Johnson
259c498d04 fileserver.clear_cache: return success and errors separately 2015-02-24 22:37:28 -06:00
Erik Johnson
8a3f9eae4e svnfs.clear_cache: return errors instead of ignoring 2015-02-24 22:37:28 -06:00
Erik Johnson
cad06a94fa hgfs.clear_cache: return errors instead of ignoring 2015-02-24 22:37:28 -06:00
Erik Johnson
7dbb5a5008 gitfs.clear_cache: return errors instead of ignoring 2015-02-24 22:37:28 -06:00
Erik Johnson
fc4f4e397b Add fileserver.clear_cache runner 2015-02-24 22:37:28 -06:00
Erik Johnson
4a6c538e2b Add function in Fileserver class to invoke fsb.clear_cache 2015-02-24 22:37:27 -06:00
Erik Johnson
154af97e69 Add salt.fileserver.svnfs.clear_cache()
Also rename purge_cache() to more accurately describe what the function
does.
2015-02-24 22:37:27 -06:00
Erik Johnson
601a589f7b Add salt.fileserver.hgfs.clear_cache()
Also rename purge_cache() to more accurately describe what the function
does.
2015-02-24 22:37:27 -06:00
Erik Johnson
64f6efa3d5 Add salt.fileserver.gitfs.clear_cache()
Also rename purge_cache() to more accurately describe what the function
does.
2015-02-24 22:37:27 -06:00
Erik Johnson
32db86c3cd gitfs: fix new branch detection (pygit2)
This fixes the same branch/tag detection issues resolved for GitPython
in the previous commit. Additionally, it refines the work done to fix
this issue in GitPython.
2015-02-24 22:37:27 -06:00
Erik Johnson
129851ed0b gitfs: fix new branch detection (GitPython)
The existing method of change detection only caught changes to existing
branches. New branches and deleted branches weren't detected as changes.

It turns out that the return value of a fetch with no changes is an
empty list, so simply checking if the return value is non-empty catches
instances where there is a new branch, as well as instances where an
existing branch was updated.

Additionally, the existence of stale refs after a fetch is now used to
determine if a local branch no longer exists on the remote repository.
These stale refs are now deleted to keep the local checkout clean.
2015-02-24 22:37:27 -06:00
jfindlay
5a5f38a8a7 Merge pull request #20984 from rallytime/fix-18725
Switch modprobe -r to rmmod in kmod.remove
2015-02-24 15:32:21 -07:00
jfindlay
8a0348458e Merge pull request #20990 from joehoyle/fix-typo-s3fs-backport
Backport fix #20987
2015-02-24 15:29:21 -07:00
Colton Myers
349ae2bac7 Merge pull request #20983 from basepi/backport_20304
[2014.7] Backport #20304 to catch msgpack errors in cmd.run
2015-02-24 14:23:14 -07:00