code: def _parse_profile(profile):
      '''
      From a pillar key, or a dictionary, return index and host keys.
      '''
      if isinstance(profile, string_types):
          _profile = __salt__['config.option'](profile)
          if not _profile:
              msg = 'Pillar key for profile {0} not found.'.format(profile)
              raise SaltInvocationError(msg)
      else:
          _profile = profile
      hosts = _profile.get('hosts')
      index = _profile.get('index')
      return (hosts, indexf _parse_profile(profile):
      '''
      From a pillar key, or a dictionary, return index and host keys.
      '''
      if isinstance(profile, string_types):
          _profile = __salt__['config.option'](profile)
          if not _profile:
              msg = 'Pillar key for profile {0} not found.'.format(profile)
              raise SaltInvocationError(msg)
      else:
          _profile = profile
      hosts = _profile.get('hosts')
      index = _profile.get('index')
      return (hosts, index)
docs: From a pillar key, or a dictionary, return index and host keys.