mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
It's urlopen
not url_open
This commit is contained in:
parent
6b19c7b03e
commit
62c541a2cf
@ -68,7 +68,7 @@ import os
|
||||
# pylint: disable=no-name-in-module,import-error
|
||||
from salt.ext.six import string_types
|
||||
from salt.ext.six.moves.urllib.request import (
|
||||
url_open as _url_open,
|
||||
urlopen as _urlopen,
|
||||
HTTPBasicAuthHandler as _HTTPBasicAuthHandler,
|
||||
HTTPDigestAuthHandler as _HTTPDigestAuthHandler,
|
||||
build_opener as _build_opener,
|
||||
@ -275,9 +275,9 @@ def _http_request(url, request_timeout=None):
|
||||
|
||||
request_timeout = __salt__['config.option']('solr.request_timeout')
|
||||
if request_timeout is None:
|
||||
data = json.load(_url_open(url))
|
||||
data = json.load(_urlopen(url))
|
||||
else:
|
||||
data = json.load(_url_open(url, timeout=request_timeout))
|
||||
data = json.load(_urlopen(url, timeout=request_timeout))
|
||||
return _get_return_dict(True, data, [])
|
||||
except Exception as err:
|
||||
return _get_return_dict(False, {}, ["{0} : {1}".format(url, err)])
|
||||
|
@ -53,7 +53,7 @@ import re
|
||||
# pylint: disable=no-name-in-module,import-error
|
||||
from salt.ext.six.moves.urllib.parse import urlencode as _urlencode
|
||||
from salt.ext.six.moves.urllib.request import (
|
||||
url_open as _url_open,
|
||||
urlopen as _urlopen,
|
||||
HTTPBasicAuthHandler as _HTTPBasicAuthHandler,
|
||||
HTTPDigestAuthHandler as _HTTPDigestAuthHandler,
|
||||
build_opener as _build_opener,
|
||||
@ -185,11 +185,11 @@ def _wget(cmd, opts=None, url='http://localhost:8080/manager', timeout=180):
|
||||
|
||||
try:
|
||||
# Trying tomcat >= 7 url
|
||||
ret['msg'] = _url_open(url, timeout=timeout).read().splitlines()
|
||||
ret['msg'] = _urlopen(url, timeout=timeout).read().splitlines()
|
||||
except Exception:
|
||||
try:
|
||||
# Trying tomcat6 url
|
||||
ret['msg'] = _url_open(url6, timeout=timeout).read().splitlines()
|
||||
ret['msg'] = _urlopen(url6, timeout=timeout).read().splitlines()
|
||||
except Exception:
|
||||
ret['msg'] = 'Failed to create HTTP request'
|
||||
|
||||
|
@ -37,7 +37,7 @@ import copy
|
||||
# pylint: disable=import-error,no-name-in-module,redefined-builtin
|
||||
from salt.ext.six import string_types, text_type
|
||||
from salt.ext.six.moves import range
|
||||
from salt.ext.six.moves.urllib.request import url_open as _url_open
|
||||
from salt.ext.six.moves.urllib.request import urlopen as _urlopen
|
||||
# pylint: enable=import-error,no-name-in-module,redefined-builtin
|
||||
|
||||
# Import salt libs
|
||||
@ -526,7 +526,7 @@ def upgrade_bootstrap(directory='.',
|
||||
'{0}.updated_bootstrap'.format(buildout_ver)))
|
||||
except (OSError, IOError):
|
||||
LOG.info('Bootstrap updated from repository')
|
||||
data = _url_open(booturl).read()
|
||||
data = _urlopen(booturl).read()
|
||||
updated = True
|
||||
dled = True
|
||||
if 'socket.setdefaulttimeout' not in data:
|
||||
|
@ -14,7 +14,7 @@ import tempfile
|
||||
import time
|
||||
|
||||
# Import 3rd-party libs
|
||||
from salt.ext.six.moves.urllib.request import url_open as _url_open # pylint: disable=no-name-in-module,import-error
|
||||
from salt.ext.six.moves.urllib.request import urlopen as _urlopen # pylint: disable=no-name-in-module,import-error
|
||||
|
||||
# Import salt libs
|
||||
import salt.key
|
||||
@ -371,7 +371,7 @@ def bootstrap_psexec(hosts='', master=None, version=None, arch='win32',
|
||||
|
||||
if not installer_url:
|
||||
base_url = 'http://docs.saltstack.com/downloads/'
|
||||
source = _url_open(base_url).read()
|
||||
source = _urlopen(base_url).read()
|
||||
salty_rx = re.compile('>(Salt-Minion-(.+?)-(.+)-Setup.exe)</a></td><td align="right">(.*?)\\s*<')
|
||||
source_list = sorted([[path, ver, plat, time.strptime(date, "%d-%b-%Y %H:%M")]
|
||||
for path, ver, plat, date in salty_rx.findall(source)],
|
||||
|
Loading…
Reference in New Issue
Block a user