def check_minion_cache(self, preserve_minions=None):
        if preserve_minions is None:
            preserve_minions = []
        m_cache = os.path.join(self.opts['cachedir'], self.ACC)
        if not os.path.isdir(m_cache):
            return
        keys = self.list_keys()
        minions = []
        for key, val in six.iteritems(keys):
            minions.extend(val)
        if not self.opts.get('preserve_minion_cache', False) or not preserve_minions:
            for minion in os.listdir(m_cache):
                if minion not in minions and minion not in preserve_minions:
                    shutil.rmtree(os.path.join(m_cache, minion))
Check the minion cache to make sure that old minion data is cleared
dataset/ETHPy150Open saltstack/salt/salt/key.py/Key.check_minion_cache