Fix gitfs/git_pillar/winrepo provider to allow lowercase values

This was an unintended side effect of the rewrite. This fix will restore
the previous (and intended) behavior.
This commit is contained in:
Erik Johnson 2016-02-08 12:18:30 -06:00
parent 64125de6c7
commit 49ec61d58b

View file

@ -111,7 +111,7 @@ def failhard(role):
class GitProvider(object):
'''
Base class for gitfs/git_pillar provider classes Should never be used
Base class for gitfs/git_pillar provider classes. Should never be used
directly.
self.provider should be set in the sub-class' __init__ function before
@ -1971,6 +1971,13 @@ class GitBase(object):
elif self.verify_dulwich(quiet=True):
self.provider = 'dulwich'
else:
# Ensure non-lowercase providers work
try:
desired_provider = desired_provider.lower()
except AttributeError:
# Should only happen if someone does something silly like
# set the provider to a numeric value.
desired_provider = str(desired_provider).lower()
if desired_provider not in self.valid_providers:
log.critical(
'Invalid {0}_provider \'{1}\'. Valid choices are: {2}'