Skip to content

Commit

Permalink
get rid of allowed_channels
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Jul 15, 2016
1 parent 4004a06 commit 12a042d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
15 changes: 0 additions & 15 deletions conda/config.py
Expand Up @@ -385,21 +385,6 @@ def url_channel(url):
schannel = canonical_channel_name(channel)
return channel, schannel

# ----- allowed channels -----

def get_allowed_channels():
if not isfile(sys_rc_path):
return None
if sys_rc.get('allow_other_channels', True):
return None
if 'channels' in sys_rc:
base_urls = ['system']
else:
base_urls = ['default']
return normalize_urls(base_urls)

allowed_channels = get_allowed_channels()

# ----- proxy -----

def get_proxy_servers():
Expand Down
10 changes: 1 addition & 9 deletions conda/fetch.py
Expand Up @@ -20,7 +20,7 @@

from .compat import itervalues, input, urllib_quote, iterkeys, iteritems
from .config import (pkgs_dirs, DEFAULT_CHANNEL_ALIAS, remove_binstar_tokens,
hide_binstar_tokens, allowed_channels, add_pip_as_python_dependency,
hide_binstar_tokens, add_pip_as_python_dependency,
ssl_verify, rc, prioritize_channels, url_channel, offline_keep)
from .connection import CondaSession, unparse_url, RETRIES, url_to_path
from .exceptions import (ProxyError, ChannelNotAllowed, CondaRuntimeError, CondaSignatureError,
Expand Down Expand Up @@ -281,14 +281,6 @@ def fetch_index(channel_urls, use_cache=False, unknown=False, index=None):
stdoutlog.info("Fetching package metadata ...")
if not isinstance(channel_urls, dict):
channel_urls = prioritize_channels(channel_urls)
for url in iterkeys(channel_urls):
if allowed_channels and url not in allowed_channels:
raise ChannelNotAllowed("""
Error: URL '%s' not in allowed channels.
Allowed channels are:
- %s
""" % (url, '\n - '.join(allowed_channels)))

urls = tuple(filter(offline_keep, channel_urls))
try:
Expand Down

0 comments on commit 12a042d

Please sign in to comment.