diff --git a/conf/minion b/conf/minion index c2c561c13c..5d230bce88 100644 --- a/conf/minion +++ b/conf/minion @@ -192,7 +192,7 @@ # A value of 10 minutes is a reasonable default. # # If the value is set to zero, this check is disabled. -#grains_refresh_every = 1 +#grains_refresh_every: 1 # When healing, a dns_check is run. This is to make sure that the originally # resolved dns has not changed. If this is something that does not happen in diff --git a/salt/grains/external_ip.py b/salt/grains/external_ip.py index 07ead5e0c7..300823253a 100644 --- a/salt/grains/external_ip.py +++ b/salt/grains/external_ip.py @@ -18,8 +18,9 @@ ''' # Import Python Libs -import urllib2 import contextlib +import socket +import urllib2 # Import salt libs from salt.utils.validate.net import ipv4_addr as _ipv4_addr @@ -40,7 +41,9 @@ def external_ip(): if not _ipv4_addr(ip_): continue return {'external_ip': ip_} - except (urllib2.HTTPError, urllib2.URLError): + except (urllib2.HTTPError, + urllib2.URLError, + socket.timeout): continue # Return an empty value as a last resort diff --git a/salt/modules/file.py b/salt/modules/file.py index c28a79bda7..da4f8d63b5 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -2126,7 +2126,8 @@ def extract_hash(hash_fn, hash_type='md5', file_name=''): source_sum = None partial_id = False name_sought = re.findall(r'^(.+)/([^/]+)$', '/x' + file_name)[0][1] - log.debug('modules.file.py - extract_hash(): Extracting hash for file named: {}'.format(name_sought)) + log.debug('modules.file.py - extract_hash(): Extracting hash for file ' + 'named: {0}'.format(name_sought)) hash_fn_fopen = salt.utils.fopen(hash_fn, 'r') for hash_variant in HASHES: if hash_type == '' or hash_type == hash_variant[0]: @@ -2136,26 +2137,29 @@ def extract_hash(hash_fn, hash_type='md5', file_name=''): hash_fn_fopen.seek(0) for line in hash_fn_fopen.read().splitlines(): hash_array = re.findall(r'(?i)(?