Try to get SDB profile from pillar (#36934)

* If sdb profile is not set in conf, try the pillar

* Carefully get sdb pillar in case this is the salt-master

* use current method of getting sdb profile name
This commit is contained in:
Theodore Cowan 2016-10-12 10:40:19 -06:00 committed by Nicole Thomas
parent 7d9fdfd0fe
commit 046aa22409

View file

@ -28,6 +28,8 @@ def sdb_get(uri, opts):
return uri
profile = opts.get(uri[sdlen:indx], {})
if not profile:
profile = opts.get('pillar', {}).get(uri[sdlen:indx], {})
if 'driver' not in profile:
return uri
@ -57,6 +59,8 @@ def sdb_set(uri, value, opts):
return False
profile = opts.get(uri[sdlen:indx], {})
if not profile:
profile = opts.get('pillar', {}).get(uri[sdlen:indx], {})
if 'driver' not in profile:
return False
@ -86,6 +90,8 @@ def sdb_delete(uri, opts):
return False
profile = opts.get(uri[sdlen:indx], {})
if not profile:
profile = opts.get('pillar', {}).get(uri[sdlen:indx], {})
if 'driver' not in profile:
return False