Repository: conda/conda

Issue:
conda 4.4.0rc: 'Not a conda environment' plus environments that shouldn't be there
I have a python 3.6 root environment with conda 4.4.0rc2 installed in /usr/local/Anaconda/conda_root/3.6.  I sourced $CONDA_ROOT/etc/profile.d/conda.sh.

```shell
$ conda --version
conda 4.4.0rc2
$ conda info

     active environment : base
    active env location : /usr/local/Anaconda/conda_root/3.6
            shell level : 1
       user config file : /home/helixapp/.condarc
 populated config files : /usr/local/Anaconda/conda_root/3.6/.condarc
          conda version : 4.4.0rc2
    conda-build version : not installed
         python version : 3.6.3.final.0
       base environment : /usr/local/Anaconda/conda_root/3.6  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
          package cache : /usr/local/Anaconda/conda_root/3.6/pkgs
                          /home/$USER/.conda/pkgs
       envs directories : /usr/local/Anaconda/conda_root/3.6/envs
                          /home/$USER/.conda/envs
               platform : linux-64
             user-agent : conda/4.4.0rc2 requests/2.14.2 CPython/3.6.2 Linux/3.10.0-693.2.2.el7.x86_64 centos/7 glibc/2.17
                UID:GID : 31672:57823
             netrc file : None
           offline mode : False
```

### Issue 1
 `conda info --envs` and `conda env list` see environments outside of the envs directories
```shell
$ conda info --envs
# conda environments:
#
0.2.2                    /spin1/sys2/usrlocal/Anaconda/envs_app/crossmap/0.2.2
1.0.0                    /spin1/sys2/usrlocal/Anaconda/envs_app/iva/1.0.0
1.0.2                    /spin1/sys2/usrlocal/Anaconda/envs_app/iva/1.0.2
base                  *  /usr/local/Anaconda/conda_root/3.6
test                     /usr/local/Anaconda/conda_root/3.6/envs/test
R3.4                     /usr/local/Anaconda/envs/R3.4
py2.7                    /usr/local/Anaconda/envs/py2.7
py3.5                    /usr/local/Anaconda/envs/py3.5
```
`conda env list` returns the same result

We have many more environments which aren't seen. But it seems to me the only ones listed should be `base` and `test`.

### Issue 2
 `conda activate test` fails due to the existence of the directory `/home/$USER/test`

```shell
$ conda activate test
Not a conda environment: /home/$USER/test
$ ls -lhd /home/$USER/test
drwxr-xr-x 3 $USER group 4.0K Nov 23 10:56 /home/$USER/test
```
`conda activate /usr/local/Anaconda/conda_root/3.6/envs/test` works. 

This works fine for `/usr/local/Anaconda/conda_root/3.6/envs/c44testing`, because the name is unique:
```shell
$ conda activate c44testing
(c44testing)$ 
```

Why is `conda activate` looking in `$HOME` for names matching the environment name? `$HOME` is not in the list of environment directories (`$HOME`/.conda/envs is)




Discussion:
> `conda info --envs` and `conda env list` see environments outside of the envs directories

This is intentional and as-designed, so long as those paths are indeed conda environments.

Issue 2 needs a solution for sure though.

Resolving patch:
diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -191,14 +191,8 @@ def _yield_commands(self, cmds_dict):
             yield self.run_script_tmpl % script
 
     def build_activate(self, env_name_or_prefix):
-        test_path = expand(env_name_or_prefix)
-        if isdir(test_path):
-            prefix = test_path
-            if not isdir(join(prefix, 'conda-meta')):
-                from .exceptions import EnvironmentLocationNotFound
-                raise EnvironmentLocationNotFound(prefix)
-        elif re.search(r'\\|/', env_name_or_prefix):
-            prefix = env_name_or_prefix
+        if re.search(r'\\|/', env_name_or_prefix):
+            prefix = expand(env_name_or_prefix)
             if not isdir(join(prefix, 'conda-meta')):
                 from .exceptions import EnvironmentLocationNotFound
                 raise EnvironmentLocationNotFound(prefix)


Test patch: