Returns the extra data from the minion's opts dict (the config file).

        This data will be passed to external pillar functions.

def get_ext_pillar_extra_minion_data(self, opts):
        '''
        Returns the extra data from the minion's opts dict (the config file).

        This data will be passed to external pillar functions.
        '''
        def get_subconfig(opts_key):
            '''
            Returns a dict containing the opts key subtree, while maintaining
            the opts structure
            '''
            ret_dict = aux_dict = {}
            config_val = opts
            subkeys = opts_key.split(':')
            # Build an empty dict with the opts path
            for subkey in subkeys[:-1]:
                aux_dict[subkey] = {}
                aux_dict = aux_dict[subkey]
                if not config_val.get(subkey):
                    # The subkey is not in the config
                    return {}
                config_val = config_val[subkey]
            if subkeys[-1] not in config_val:
                return {}
            aux_dict[subkeys[-1]] = config_val[subkeys[-1]]
            return ret_dict

        extra_data = {}
        if 'pass_to_ext_pillars' in opts:
            if not isinstance(opts['pass_to_ext_pillars'], list):
                log.exception('\'pass_to_ext_pillars\' config is malformed.')
                raise SaltClientError('\'pass_to_ext_pillars\' config is '
                                      'malformed.')
            for key in opts['pass_to_ext_pillars']:
                salt.utils.dictupdate.update(extra_data,
                                             get_subconfig(key),
                                             recursive_update=True,
                                             merge_lists=True)
        log.trace('ext_pillar_extra_data = %s', extra_data)
        return extra_data