Repository: conda/conda

Issue:
"conda info -a" doesn't tell whole story about condarc files
TL;DR: `conda info -a` and `conda config --show` need to list EVERY configuration file they are going to read in, not just the first one they find.

I'm using conda inside Anaconda Enterprise.  I have conda 4.2.14 in this case (but I've checked and this same problem comes up with 4.3.16).  I do a `conda info -a` operation and there are many surprising entries that I cannot find in the listed `.condarc` file:

```
$ conda info -a | grep -i condarc
            config file : /projects/ijstokes/MarketStructureAnalysis/.condarc

$ cat /projects/ijstokes/MarketStructureAnalysis/.condarc
envs_dirs: [/projects/ijstokes/MarketStructureAnalysis/envs]
channel_alias: http://repo.demo.continuum.io/
ssl_verify: False
```

From some digging I believe this is because conda is picking up a configuration file in `/opt/wakari/anaconda/.condarc` that isn't being reported anywhere (so how would the average person know to go looking for it?)

Here is my output:

```
$ conda info -a
Current conda install:                                                                                   
                                                                                                         
               platform : linux-64                                                                       
          conda version : 4.2.14                                                                         
       conda is private : False                                                                          
      conda-env version : 4.2.14                                                                         
    conda-build version : 2.0.6                                                                          
         python version : 2.7.12.final.0                                                                 
       requests version : 2.12.4                                                                         
       root environment : /opt/wakari/anaconda  (read only)                                              
    default environment : /projects/ijstokes/MarketStructureAnalysis/envs/default                        
       envs directories : /projects/ijstokes/MarketStructureAnalysis/DEFAULTS                            
                          /projects/ijstokes/MarketStructureAnalysis/envs                                
                          /home/ijstokes/.conda/envs                                                     
                          /opt/wakari/anaconda/envs                                                      
          package cache : /projects/ijstokes/MarketStructureAnalysis/DEFAULTS/.pkgs                      
                          /projects/ijstokes/MarketStructureAnalysis/envs/.pkgs                          
                          /home/ijstokes/.conda/envs/.pkgs                                               
                          /opt/wakari/anaconda/pkgs                                                      
           channel URLs : https://conda.anaconda.org/t/<TOKEN>/anaconda-nb-extensions/linux-64 
                          https://conda.anaconda.org/t/<TOKEN>/anaconda-nb-extensions/noarch             
                          http://repo.demo.continuum.io/conda/r-channel/linux-64                         
                          http://repo.demo.continuum.io/conda/r-channel/noarch                           
                          http://repo.demo.continuum.io/conda/wakari/linux-64                            
                          http://repo.demo.continuum.io/conda/wakari/noarch                              
                          http://repo.demo.continuum.io/conda/anaconda/linux-64                          
                          http://repo.demo.continuum.io/conda/anaconda/noarch                            
                          http://repo.demo.continuum.io/conda/anaconda-cluster/linux-64                  
                          http://repo.demo.continuum.io/conda/anaconda-cluster/noarch                    
            config file : /projects/ijstokes/MarketStructureAnalysis/.condarc                            
           offline mode : False                                                                          
                                                                                                         
# conda environments:                                                                                    
#                                                                                                        
default               *  /projects/ijstokes/MarketStructureAnalysis/envs/default                         
root                     /opt/wakari/anaconda                                                            
                                                                                                         
sys.version: 2.7.12 |Anaconda custom (64-bit)| (defau...                                                 
sys.prefix: /opt/wakari/anaconda                                                                         
sys.executable: /opt/wakari/anaconda/bin/python                                                          
conda location: /opt/wakari/anaconda/lib/python2.7/site-packages/conda                                   
conda-build: /opt/wakari/anaconda/bin/conda-build                                                        
conda-convert: /opt/wakari/anaconda/bin/conda-convert                                                    
conda-develop: /opt/wakari/anaconda/bin/conda-develop                                                    
conda-env: /opt/wakari/anaconda/bin/conda-env                                                            
conda-index: /opt/wakari/anaconda/bin/conda-index                                                        
conda-inspect: /opt/wakari/anaconda/bin/conda-inspect                                                    
conda-metapackage: /opt/wakari/anaconda/bin/conda-metapackage                                            
conda-render: /opt/wakari/anaconda/bin/conda-render                                                      
conda-server: /opt/wakari/anaconda/bin/conda-server                                                      
conda-sign: /opt/wakari/anaconda/bin/conda-sign                                                          
conda-skeleton: /opt/wakari/anaconda/bin/conda-skeleton                                                  
user site dirs:                                                                                          
                                                                                                         
CIO_TEST: <not set>                                                                                      
CONDA_DEFAULT_ENV: /projects/ijstokes/MarketStructureAnalysis/envs/default                               
CONDA_ENVS_PATH: DEFAULTS                                                                                
LD_LIBRARY_PATH: <not set>                                                                               
PATH: /opt/wakari/anaconda/bin:/opt/anaconda/bin:/projects/ijstokes/MarketStructureAnalysis/envs/default/
bin:/opt/wakari/anaconda/bin:/opt/anaconda/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/opt/aws/bin
:/home/ijstokes/.local/bin:/home/ijstokes/bin:/opt/aws/bin                                               
PYTHONHOME: <not set>                                                                                    
PYTHONPATH: <not set>                                                                                    
                                                                                                         
License directories:                                                                                     
    /home/ijstokes/.continuum                                                                            
    /opt/wakari/anaconda/licenses                                                                        
License files (license*.txt):                                                                            
Package/feature end dates: 
```

From another angle:

```
$ conda config --show
add_anaconda_token: True                                                                                 
add_pip_as_python_dependency: True                                                                       
allow_softlinks: True                                                                                    
always_copy: False                                                                                       
always_yes: False                                                                                        
auto_update_conda: True                                                                                  
binstar_upload: None                                                                                     
changeps1: True                                                                                          
channel_alias: http://repo.demo.continuum.io                                                             
channel_priority: True                                                                                   
channels:                                                                                                
  - https://conda.anaconda.org/t/an-a642ee89-46f1-41b5-8ebf-0c4ec42db9cb/anaconda-nb-extensions          
  - http://repo.demo.continuum.io/conda/r-channel                                                        
  - http://repo.demo.continuum.io/conda/wakari                                                           
  - http://repo.demo.continuum.io/conda/anaconda                                                         
  - http://repo.demo.continuum.io/conda/anaconda-cluster                                                 
client_tls_cert:                                                                                         
client_tls_cert_key:                                                                                     
create_default_packages:                                                                                 
  - anaconda-client                                                                                      
  - ipykernel                                                                                            
debug: False                                                                                             
default_channels:                                                                                        
  - http://repo.demo.continuum.io/conda/wakari                                                           
  - http://repo.demo.continuum.io/conda/anaconda                                                         
  - http://repo.demo.continuum.io/conda/anaconda-cluster                                                 
  - http://repo.demo.continuum.io/conda/r-channel                                                        
disallow: []                                                                                             
envs_dirs:                                                                                               
  - /projects/ijstokes/MarketStructureAnalysis/DEFAULTS                                                  
  - /projects/ijstokes/MarketStructureAnalysis/envs                                                      
  - /home/ijstokes/.conda/envs                                                                           
  - /opt/wakari/anaconda/envs                                                                            
json: False                                                                                              
offline: False                                                                                           
proxy_servers: {}                                                                                        
quiet: False                                                                                             
shortcuts: True                                                                                          
show_channel_urls: None                                                                                  
ssl_verify: False                                                                                        
track_features: []                                                                                       
update_dependencies: True                                                                                
use_pip: True                                                                                            
verbosity: 0
```

And finally the "hidden" configuration file:

```
$ cat /opt/wakari/anaconda/.condarc              
channels:                                                                                                
  - https://conda.anaconda.org/t/an-a642ee89-46f1-41b5-8ebf-0c4ec42db9cb/anaconda-nb-extensions          
#  - http://repo.demo.continuum.io/conda/wakari                                                          
  - http://repo.demo.continuum.io/conda/r-channel                                                        
  - http://repo.demo.continuum.io/conda/wakari                                                           
  - http://repo.demo.continuum.io/conda/anaconda                                                         
  - http://repo.demo.continuum.io/conda/anaconda-cluster                                                 
#  - http://repo.demo.continuum.io/conda/r-channel                                                       
                                                                                                         
create_default_packages:                                                                                 
  - anaconda-client                                                                                      
  - ipykernel                                                                                            
                                                                                                         
  #- anaconda-client                                                                                     
  #- python                                                                                              
  #- ipython-we                                                                                          
  #- pip                                                                                                 
                                                                                                         
# Default channels is needed for when users override the system .condarc                                 
# with ~/.condarc.  This ensures that "defaults" maps to your Anaconda Server and not                    
# repo.continuum.io                                                                                      
                                                                                                         
                                                                                                         
default_channels:                                                                                        
  - http://repo.demo.continuum.io/conda/wakari                                                           
  - http://repo.demo.continuum.io/conda/anaconda                                                         
  - http://repo.demo.continuum.io/conda/anaconda-cluster                                                 
  - http://repo.demo.continuum.io/conda/r-channel                                                        
                                                                                                         
# channel_alias: http://repo.demo.continuum.io/conda
```
cc @damianavila, @bkreider 


Discussion:
Have you tried `conda config --show-sources`?
`conda config --show` doesn't show values from the first configuration file found.  It shows the final, compiled result from all configuration found.  `conda config --show-sources` shows all recognized, uncompiled values in all recognized sources.

@kalefranz thanks for clarifying.  I think I'd still maintain that the `-a` option on `conda info -a` is not telling the complete story: it should list all configuration files (since `-a` is short for `--all`) rather than make it seem like there is only one config file.  You'll see that I did try `conda config --show`.  I'll leave it to you to decide if this should remain open or be closed.
I think i agree with you @ijstokes.  The "config file" key should be enhanced to be a list of config files.  Or if you want backward compatibility a new key "config files" should be adding listing all of them and the "config file" key can indicate the highest priority config file.
> Or if you want backward compatibility a new key "config files" should be adding listing all of them and the "config file" key can indicate the highest priority config file.

That can definitely be done!

I guess it would default to being empty if there isn't any configuration set on the system at all?

Resolving patch:
diff --git a/conda/cli/main_info.py b/conda/cli/main_info.py
--- a/conda/cli/main_info.py
+++ b/conda/cli/main_info.py
@@ -198,6 +198,9 @@ def get_info_dict(system=False):
                     for c in channels]
     channels = [mask_anaconda_token(c) for c in channels]
 
+    config_files = tuple(path for path in context.collect_all()
+                         if path not in ('envvars', 'cmd_line'))
+
     info_dict = dict(
         platform=context.subdir,
         conda_version=conda_version,
@@ -221,6 +224,7 @@ def get_info_dict(system=False):
         requests_version=requests_version,
         user_agent=context.user_agent,
         conda_location=CONDA_PACKAGE_ROOT,
+        config_files=config_files,
     )
     if on_win:
         from ..common.platform import is_admin_on_windows
@@ -252,7 +256,7 @@ def get_info_dict(system=False):
 def get_main_info_str(info_dict):
     from .._vendor.auxlib.ish import dals
 
-    for key in 'pkgs_dirs', 'envs_dirs', 'channels':
+    for key in 'pkgs_dirs', 'envs_dirs', 'channels', 'config_files':
         info_dict['_' + key] = ('\n' + 26 * ' ').join(info_dict[key])
     info_dict['_rtwro'] = ('writable' if info_dict['root_writable'] else 'read only')
 
@@ -273,6 +277,7 @@ def get_main_info_str(info_dict):
               package cache : %(_pkgs_dirs)s
                channel URLs : %(_channels)s
                 config file : %(rc_path)s
+               config files : %(_config_files)s
                offline mode : %(offline)s
                  user-agent : %(user_agent)s\
     """) % info_dict)


Test patch: