Make AsyncPillar API compatible with AsyncRemotePillar

Fixes #51186
This commit is contained in:
Pedro Algarvio 2019-01-17 17:14:43 +00:00
parent 1dc57094c2
commit 430491b388
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

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.