diff options
author | Micah Anderson <micah@riseup.net> | 2013-02-21 15:30:52 -0500 |
---|---|---|
committer | kwadronaut <kwadronaut@leap.se> | 2013-09-07 01:59:47 +0200 |
commit | f92d09226cfddb0c7e5e342dd199d8ea05b497cb (patch) | |
tree | 20b89161162cebdc3301274c8e6129d3f2682bf9 /054d16421c782dd76a6990856bb78797abe36750 | |
parent | a4ee585cb17751dca8cf49d9361124e438a39d87 (diff) |
Due to a network anomaly during a vcsrepo git clone you can get a
'non-repository' at the path. That can be even just an empty directory. This
makes it so further puppet runs cannot ever complete properly, because of this
error:
change from absent to present failed: Could not create repository (non-repository at path)
This requires manual intervention to resolve (ie. removing the directory).
It is possible to pass the 'force => true' parameter to vcsrepo to handle this,
however, all this will do is remove whatever is there, even if it is a valid
repository. That means on every puppet run you get the tree removed and then a
new clone is done. This is less than ideal for a number of reasons.
So this commit adds a test to determine if the location contains a valid
repository and then it is used when 'force => true' to determine if it should
replace the existing content with a fresh clone.
Note: the valid_repo? check is also added to the 'def bare_git_config_exists?'
because the test that is done there is intended to look for a bare git
repository by checking to see if there 'config' is in the directory. This isn't
a particularly robust test because 'config' could be in a directory, when it
isn't a bare git repository (such as is common in a rails app) causing vcsrepo
to mistakenly think it was a proper bare repository, when it isn't.
Diffstat (limited to '054d16421c782dd76a6990856bb78797abe36750')
0 files changed, 0 insertions, 0 deletions