Repository: conda/conda

Issue:
BUG: CONDARC env var broken in latest conda
After upgrading to conda version 4.2.7 the CONDARC env var no longer supports filenames of any format.  It appears to only support filenames that end with .yml or .condarc.
This is a functionality regression bug.  Can this be fixed immediately!?

**conda info**
Current conda install:

```
           platform : osx-64
      conda version : 4.2.7
   conda is private : False
  conda-env version : 4.2.7
conda-build version : 1.21.3
     python version : 2.7.12.final.0
   requests version : 2.9.1
   root environment : /opt/anaconda  (writable)
default environment : /opt/anaconda
   envs directories : /opt/anaconda/envs
      package cache : /opt/anaconda/pkgs
       channel URLs : https://repo.continuum.io/pkgs/free/osx-64/
                      https://repo.continuum.io/pkgs/free/noarch/
                      https://repo.continuum.io/pkgs/pro/osx-64/
                      https://repo.continuum.io/pkgs/pro/noarch/
                      https://conda.anaconda.org/r/osx-64/
                      https://conda.anaconda.org/r/noarch/
        config file : /Users/jhull/.condarc
       offline mode : False
```

**export CONDARC=~/.condarc.cloud**

**conda info**
Traceback (most recent call last):
  File "/opt/anaconda/bin/conda", line 4, in <module>
    import conda.cli
  File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/**init**.py", line 8, in <module>
    from .main import main  # NOQA
  File "/opt/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 46, in <module>
    from ..base.context import context
  File "/opt/anaconda/lib/python2.7/site-packages/conda/base/context.py", line 252, in <module>
    context = Context(SEARCH_PATH, conda, None)
  File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 692, in **init**
    self._add_search_path(search_path)
  File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 699, in _add_search_path
    return self._add_raw_data(load_file_configs(search_path))
  File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 371, in load_file_configs
    raw_data = odict(kv for kv in chain.from_iterable(load_paths))
  File "/opt/anaconda/lib/python2.7/collections.py", line 69, in __init__
    self.__update(_args, *_kwds)
  File "/opt/anaconda/lib/python2.7/_abcoll.py", line 571, in update
    for key, value in other:
  File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 371, in <genexpr>
    raw_data = odict(kv for kv in chain.from_iterable(load_paths))
  File "/opt/anaconda/lib/python2.7/site-packages/conda/common/configuration.py", line 346, in _file_yaml_loader
    **assert fullpath.endswith(".yml") or fullpath.endswith("condarc"), fullpath
AssertionError: /Users/jhull/.condarc.cloud**



Discussion:
Added to my list to talk through with @mcg1969 tomorrow.


Resolving patch:
diff --git a/conda/common/configuration.py b/conda/common/configuration.py
--- a/conda/common/configuration.py
+++ b/conda/common/configuration.py
@@ -23,7 +23,7 @@
 from itertools import chain
 from logging import getLogger
 from os import environ, stat
-from os.path import join
+from os.path import join, basename
 from stat import S_IFDIR, S_IFMT, S_IFREG
 
 try:
@@ -343,7 +343,7 @@ def load_file_configs(search_path):
     # returns an ordered map of filepath and dict of raw parameter objects
 
     def _file_yaml_loader(fullpath):
-        assert fullpath.endswith(".yml") or fullpath.endswith("condarc"), fullpath
+        assert fullpath.endswith((".yml", ".yaml")) or "condarc" in basename(fullpath), fullpath
         yield fullpath, YamlRawParameter.make_raw_parameters_from_file(fullpath)
 
     def _dir_yaml_loader(fullpath):


Test patch: