Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #30844 to 2015.8 branch #30847

Merged
merged 4 commits into from Feb 3, 2016
Merged

Conversation

terminalmage
Copy link
Contributor

See #30844.

Kris Raney and others added 4 commits February 2, 2016 21:58
When configured to use a gitpython-based ext_pillar, salt-call --local (I don't have a master) was giving the error:
  Failed to checkout <branch> from git_pillar remote '<repo location>': remote ref does not exist
regardless of whether the branch existed or not. Poking around in the cache directory, I found that the cloned repository had a remote named 'origin' set, but no fetch had ever been done, so 'git checkout' would always fail. It doesn't know about any branches yet.

Adding the fetch here, immediately after creating the remote, resolves the problem.

I'm not totally sure this is the _correct_ fix as I'm not familiar with this code, and this code is used in many situations, not just minced. But I believe it to be harmless in the worst case, a redundant fetch.
This prevents the master's maintenance process from attempting to run a
fetch while GitBase.init_remotes() is in the process fetching a
newly-added remote.

We have proper locking in place, so there is no danger of a race
condition, but this does suppress the warning generated when an update
lock is in place at the time a fetch is attempted.
@terminalmage
Copy link
Contributor Author

I can't reproduce the test failure on a cent7 box, and it doesn't appear related to this PR.

cachedout pushed a commit that referenced this pull request Feb 3, 2016
@cachedout cachedout merged commit 0338f44 into saltstack:2015.8 Feb 3, 2016
@terminalmage terminalmage deleted the bp-30844 branch February 3, 2016 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants