pillar_prefix is the pillar.get syntax for the pillar to be queried.
        Group name is gotten via the equivalent of using
        ``salt['pillar.get']('{}:{}'.format(pillar_prefix, group_name))``
        in a jinja template.

        returns a dictionary (unless the pillar is mis-formatted)
        XXX: instead of using Caller, make the minion to use configurable so there could be some
             restrictions placed on what pillars can be used.

def _groups_from_pillar(self, pillar_name):
        '''
        pillar_prefix is the pillar.get syntax for the pillar to be queried.
        Group name is gotten via the equivalent of using
        ``salt['pillar.get']('{}:{}'.format(pillar_prefix, group_name))``
        in a jinja template.

        returns a dictionary (unless the pillar is mis-formatted)
        XXX: instead of using Caller, make the minion to use configurable so there could be some
             restrictions placed on what pillars can be used.
        '''
        if pillar_name and __opts__['__role'] == 'minion':
            pillar_groups = __salt__['pillar.get'](pillar_name, {})
            log.debug('Got pillar groups %s from pillar %s', pillar_groups, pillar_name)
            log.debug('pillar groups is %s', pillar_groups)
            log.debug('pillar groups type is %s', type(pillar_groups))
        else:
            pillar_groups = {}
        return pillar_groups