Merge pull request #51222 from s0undt3ch/2019.2.0.rc1

Make `AsyncPillar` API compatible with `AsyncRemotePillar` - Fixes #51186
This commit is contained in:
Gareth J. Greenaway 2019-01-17 12:42:09 -08:00 committed by GitHub
commit 241eabe860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -406,6 +406,7 @@ class Pillar(object):
if not isinstance(self.extra_minion_data, dict):
self.extra_minion_data = {}
log.error('Extra minion data must be a dictionary')
self._closing = False
def __valid_on_demand_ext_pillar(self, opts):
'''
@ -1109,6 +1110,17 @@ class Pillar(object):
log.error(msg, exc_info=True)
return errors
def destroy(self):
'''
This method exist in order to be API compatible with RemotePillar
'''
if self._closing:
return
self._closing = True
def __del__(self):
self.destroy()
# TODO: actually migrate from Pillar to AsyncPillar to allow for futures in
# ext_pillar etc.