Resolves :attr:`config_spec` to a path to a config file.

    :param str config_spec:  Valid config specs:

        - The basename of a YAML config file *without* the ``.yml`` extension.
          The full path to the config file is resolved by appending ``.yml`` to
          the basename, then by searching for the result in the
          :attr:`config_dir`.

        - The path to a YAML config file.  The path may be absolute or may be
          relative to the current working directory.  If :attr:`config_spec`
          contains a ``/`` (forward slash), or if it ends in ``.yml``, it is
          treated as a path.

    :param str config_dir:  The directory in which to search for stack
        configuration files.

    :rtype:  :class:`str`

def resolve_config_spec(config_spec, config_dir=''):
    """
    Resolves :attr:`config_spec` to a path to a config file.

    :param str config_spec:  Valid config specs:

        - The basename of a YAML config file *without* the ``.yml`` extension.
          The full path to the config file is resolved by appending ``.yml`` to
          the basename, then by searching for the result in the
          :attr:`config_dir`.

        - The path to a YAML config file.  The path may be absolute or may be
          relative to the current working directory.  If :attr:`config_spec`
          contains a ``/`` (forward slash), or if it ends in ``.yml``, it is
          treated as a path.

    :param str config_dir:  The directory in which to search for stack
        configuration files.

    :rtype:  :class:`str`

    """
    if '/' in config_spec or config_spec.endswith('.yml'):
        return config_spec
    return os.path.join(config_dir, '%s.yml' % config_spec)