import yaml
import logging


def load_yaml_options(config_path):
  """Load options from the YAML file at the specified path.

  Returns an empty dictionary and logs a warning on error.
  """
  config = {}
  try:
    with open(config_path, 'r') as stream:
      config = yaml.safe_load(stream)
      logging.info('Loaded config from %s', config_path)
  except IOError:
    logging.warn('Failed to load %s', config_path)
  return config