mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #31904 from rallytime/merge-2015.8
[2015.8] Merge forward from 2015.5 to 2015.8
This commit is contained in:
commit
03e8b72655
38 changed files with 234 additions and 84 deletions
|
@ -80,11 +80,21 @@ disable=R,
|
|||
I0011,
|
||||
I0012,
|
||||
I0013,
|
||||
E0302,
|
||||
E0401,
|
||||
E1101,
|
||||
E1103,
|
||||
E1136,
|
||||
E8114,
|
||||
C0102,
|
||||
C0103,
|
||||
C0111,
|
||||
C0112,
|
||||
C0122,
|
||||
C0123,
|
||||
C0411,
|
||||
C0412,
|
||||
C0413,
|
||||
C0203,
|
||||
C0204,
|
||||
C0301,
|
||||
|
@ -130,11 +140,19 @@ disable=R,
|
|||
# I0011 (locally-disabling)
|
||||
# I0012 (locally-enabling)
|
||||
# I0013 (file-ignored)
|
||||
# E0302 (unexpected-special-method-signature)
|
||||
# E0401 (import-error)
|
||||
# E1101 (no-member) [pylint isn't smart enough]
|
||||
# E1103 (maybe-no-member)
|
||||
# E1136 (unsubscriptable-object)
|
||||
# E8114 (indentation-is-not-a-multiple-of-four-comment)
|
||||
# C0102 (blacklisted-name) [because it activates C0103 too]
|
||||
# C0103 (invalid-name)
|
||||
# C0111 (missing-docstring)
|
||||
# C0113 (unneeded-not)
|
||||
# C0122 (misplaced-comparison-constant)
|
||||
# C0123 (unidiomatic-typecheck)
|
||||
# C0412 (ungrouped-imports)
|
||||
# C0203 (bad-mcs-method-argument)
|
||||
# C0204 (bad-mcs-classmethod-argument)
|
||||
# C0301 (line-too-long)
|
||||
|
@ -180,6 +198,7 @@ output-format=text
|
|||
files-output=no
|
||||
|
||||
# Tells whether to display a full report or only the messages
|
||||
# This will be removed in pylint 1.6
|
||||
reports=no
|
||||
|
||||
# Python expression which should return a note less than 10 (10 is the highest
|
||||
|
|
|
@ -71,15 +71,15 @@ defaults:
|
|||
|
||||
{{ salt['grains.get']('os') }}
|
||||
|
||||
env
|
||||
====
|
||||
saltenv
|
||||
=======
|
||||
|
||||
The `env` variable is available in only in sls files when gathering the sls
|
||||
The `saltenv` variable is available in only in sls files when gathering the sls
|
||||
from an environment.
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
{{ env }}
|
||||
{{ saltenv }}
|
||||
|
||||
sls
|
||||
====
|
||||
|
@ -91,4 +91,4 @@ include option.
|
|||
|
||||
.. code-block:: jinja
|
||||
|
||||
{{ sls }}
|
||||
{{ sls }}
|
||||
|
|
90
doc/topics/releases/2014.7.8.rst
Normal file
90
doc/topics/releases/2014.7.8.rst
Normal file
|
@ -0,0 +1,90 @@
|
|||
===========================
|
||||
Salt 2014.7.8 Release Notes
|
||||
===========================
|
||||
|
||||
Changes for v2014.7.7..v2014.7.8
|
||||
--------------------------------
|
||||
|
||||
Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs):
|
||||
|
||||
*Generated at: 2016-03-11T21:18:48Z*
|
||||
|
||||
Statistics:
|
||||
|
||||
- Total Merges: **7**
|
||||
- Total Issue references: **3**
|
||||
- Total PR references: **10**
|
||||
|
||||
Changes:
|
||||
|
||||
|
||||
- **PR** `#28839`_: (*cachedout*) Revert `#28740`_
|
||||
@ *2015-11-12T22:54:28Z*
|
||||
|
||||
- **PR** `#28740`_: (*MasterNayru*) Add missing S3 module import
|
||||
| refs: `#28777`_
|
||||
* 4b8bdd0 Merge pull request `#28839`_ from cachedout/revert_28740
|
||||
* 215b26c Revert `#28740`_
|
||||
|
||||
- **PR** `#28777`_: (*rallytime*) Back-port `#28740`_ to 2014.7
|
||||
@ *2015-11-11T18:00:00Z*
|
||||
|
||||
- **PR** `#28740`_: (*MasterNayru*) Add missing S3 module import
|
||||
| refs: `#28777`_
|
||||
* 76e69b4 Merge pull request `#28777`_ from rallytime/`bp-28740`_-2014.7
|
||||
* da5fac2 Back-port `#28740`_ to 2014.7
|
||||
|
||||
- **PR** `#28716`_: (*rallytime*) Back-port `#28705`_ to 2014.7
|
||||
@ *2015-11-10T16:15:03Z*
|
||||
|
||||
- **PR** `#28705`_: (*cachedout*) Account for new headers class in tornado 4.3
|
||||
| refs: `#28716`_
|
||||
* 45c73eb Merge pull request `#28716`_ from rallytime/`bp-28705`_
|
||||
* 32e7bd3 Account for new headers class in tornado 4.3
|
||||
|
||||
- **PR** `#28717`_: (*cachedout*) Add note about recommended umask
|
||||
@ *2015-11-09T23:26:20Z*
|
||||
|
||||
- **ISSUE** `#28199`_: (*felskrone*) Non-standard umasks might break the master
|
||||
| refs: `#28717`_
|
||||
* f4fe921 Merge pull request `#28717`_ from cachedout/umask_note
|
||||
* 1874300 Add note about recommended umask
|
||||
|
||||
- **PR** `#28461`_: (*cachedout*) Wrap all cache calls in state.sls in correct umask
|
||||
@ *2015-11-02T17:11:02Z*
|
||||
|
||||
- **ISSUE** `#28455`_: (*zmalone*) highstate.cache is world readable, and contains secrets
|
||||
| refs: `#28461`_
|
||||
* 4bf56ca Merge pull request `#28461`_ from cachedout/issue_28455
|
||||
* 097838e Wrap all cache calls in state.sls in correct umask
|
||||
|
||||
- **PR** `#28407`_: (*DmitryKuzmenko*) Don't request creds if auth with key.
|
||||
@ *2015-10-29T16:12:30Z*
|
||||
|
||||
- **ISSUE** `#24910`_: (*bocig*) -T, --make-token flag does NOT work- LDAP Groups
|
||||
| refs: `#28407`_
|
||||
* f3e61db Merge pull request `#28407`_ from DSRCompany/issues/24910_token_auth_fix_2014
|
||||
* b7b5bec Don't request creds if auth with key.
|
||||
|
||||
- **PR** `#27390`_: (*JaseFace*) Ensure we pass on the enable setting if present, or use the default of True if not in build_schedule_item()
|
||||
@ *2015-10-05T18:09:33Z*
|
||||
|
||||
* d284eb1 Merge pull request `#27390`_ from JaseFace/schedule-missing-enabled
|
||||
* 563db71 Ensure we pass on the enable setting if present, or use the default of True if not in build_schedule_item() Prior to this, when schedule.present compares the existing schedule to the one crafted by this function, enabled will actually be removed at each run. schedule.present sees a modification needs to be made, and invokes schedule.modify, which does so with enabled: True, creating and endless loop of an 'enabled' removal and addition.
|
||||
|
||||
|
||||
.. _`#24910`: https://github.com/saltstack/salt/issues/24910
|
||||
.. _`#27390`: https://github.com/saltstack/salt/pull/27390
|
||||
.. _`#28199`: https://github.com/saltstack/salt/issues/28199
|
||||
.. _`#28407`: https://github.com/saltstack/salt/pull/28407
|
||||
.. _`#28455`: https://github.com/saltstack/salt/issues/28455
|
||||
.. _`#28461`: https://github.com/saltstack/salt/pull/28461
|
||||
.. _`#28705`: https://github.com/saltstack/salt/pull/28705
|
||||
.. _`#28716`: https://github.com/saltstack/salt/pull/28716
|
||||
.. _`#28717`: https://github.com/saltstack/salt/pull/28717
|
||||
.. _`#28740`: https://github.com/saltstack/salt/pull/28740
|
||||
.. _`#28777`: https://github.com/saltstack/salt/pull/28777
|
||||
.. _`#28839`: https://github.com/saltstack/salt/pull/28839
|
||||
.. _`bp-28705`: https://github.com/saltstack/salt/pull/28705
|
||||
.. _`bp-28740`: https://github.com/saltstack/salt/pull/28740
|
||||
|
45
doc/topics/releases/2014.7.9.rst
Normal file
45
doc/topics/releases/2014.7.9.rst
Normal file
|
@ -0,0 +1,45 @@
|
|||
===========================
|
||||
Salt 2014.7.9 Release Notes
|
||||
===========================
|
||||
|
||||
Changes for v2014.7.8..v2014.7.9
|
||||
--------------------------------
|
||||
|
||||
Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs):
|
||||
|
||||
*Generated at: 2016-03-11T20:58:58Z*
|
||||
|
||||
Statistics:
|
||||
|
||||
- Total Merges: **3**
|
||||
- Total Issue references: **1**
|
||||
- Total PR references: **3**
|
||||
|
||||
Changes:
|
||||
|
||||
|
||||
- **PR** `#31826`_: (*gtmanfred*) Remove ability of authenticating user to specify pam service
|
||||
@ *2016-03-11T20:41:01Z*
|
||||
|
||||
* c5e7c03 Merge pull request `#31826`_ from gtmanfred/2014.7
|
||||
* d73f70e Remove ability of authenticating user to specify pam service
|
||||
|
||||
- **PR** `#29392`_: (*jacobhammons*) updated version number to not reference a specific build from the lat…
|
||||
@ *2015-12-03T15:54:31Z*
|
||||
|
||||
* 85aa70a Merge pull request `#29392`_ from jacobhammons/2014.7
|
||||
* d7f0db1 updated version number to not reference a specific build from the latest branch
|
||||
|
||||
- **PR** `#29296`_: (*douardda*) Use process KillMode on Debian systems also
|
||||
@ *2015-12-01T16:00:16Z*
|
||||
|
||||
- **ISSUE** `#29295`_: (*douardda*) systemd's service file should use the 'process' KillMode option on Debian also
|
||||
| refs: `#29296`_
|
||||
* d2fb210 Merge pull request `#29296`_ from douardda/patch-3
|
||||
* d288539 Use process KillMode on Debian systems also
|
||||
|
||||
|
||||
.. _`#29295`: https://github.com/saltstack/salt/issues/29295
|
||||
.. _`#29296`: https://github.com/saltstack/salt/pull/29296
|
||||
.. _`#29392`: https://github.com/saltstack/salt/pull/29392
|
||||
.. _`#31826`: https://github.com/saltstack/salt/pull/31826
|
|
@ -60,7 +60,7 @@ def __define_global_system_encoding_variable__():
|
|||
# than expected. See:
|
||||
# https://github.com/saltstack/salt/issues/21036
|
||||
if sys.version_info[0] < 3:
|
||||
import __builtin__ as builtins # pylint: disable=incompatible-py3-code
|
||||
import __builtin__ as builtins
|
||||
else:
|
||||
import builtins # pylint: disable=import-error
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ if PY3:
|
|||
import builtins
|
||||
exceptions = builtins
|
||||
else:
|
||||
import exceptions # pylint: disable=incompatible-py3-code
|
||||
import exceptions
|
||||
|
||||
|
||||
if not hasattr(ElementTree, 'ParseError'):
|
||||
|
|
|
@ -15,7 +15,6 @@ import struct
|
|||
|
||||
# Import Salt Libs
|
||||
import salt.utils
|
||||
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
|
||||
|
||||
__virtualname__ = 'btmp'
|
||||
BTMP = '/var/log/btmp'
|
||||
|
@ -87,9 +86,9 @@ def beacon(config):
|
|||
__context__[LOC_KEY] = fp_.tell()
|
||||
pack = struct.unpack(FMT, raw)
|
||||
event = {}
|
||||
for ind in range(len(FIELDS)):
|
||||
event[FIELDS[ind]] = pack[ind]
|
||||
if isinstance(event[FIELDS[ind]], str):
|
||||
event[FIELDS[ind]] = event[FIELDS[ind]].strip('\x00')
|
||||
for ind, field in enumerate(FIELDS):
|
||||
event[field] = pack[ind]
|
||||
if isinstance(event[field], str):
|
||||
event[field] = event[field].strip('\x00')
|
||||
ret.append(event)
|
||||
return ret
|
||||
|
|
|
@ -10,7 +10,6 @@ import time
|
|||
# Import salt libs
|
||||
import salt.utils
|
||||
import salt.utils.vt
|
||||
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
|
||||
|
||||
__virtualname__ = 'sh'
|
||||
|
||||
|
@ -95,12 +94,12 @@ def beacon(config):
|
|||
'tag': pid}
|
||||
if 'execve' in line:
|
||||
comps = line.split('execve')[1].split('"')
|
||||
for ind in range(len(comps)):
|
||||
for ind, field in enumerate(comps):
|
||||
if ind == 1:
|
||||
event['cmd'] = comps[ind]
|
||||
event['cmd'] = field
|
||||
continue
|
||||
if ind % 2 != 0:
|
||||
event['args'].append(comps[ind])
|
||||
event['args'].append(field)
|
||||
event['user'] = __context__[pkey][pid]['user']
|
||||
ret.append(event)
|
||||
if not __context__[pkey][pid]['vt'].isalive():
|
||||
|
|
|
@ -13,9 +13,6 @@ from __future__ import absolute_import
|
|||
import os
|
||||
import struct
|
||||
|
||||
# Import 3rd-party libs
|
||||
from salt.ext.six.moves import range
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
|
||||
|
@ -91,9 +88,9 @@ def beacon(config):
|
|||
__context__[LOC_KEY] = fp_.tell()
|
||||
pack = struct.unpack(FMT, raw)
|
||||
event = {}
|
||||
for ind in range(len(FIELDS)):
|
||||
event[FIELDS[ind]] = pack[ind]
|
||||
if isinstance(event[FIELDS[ind]], str):
|
||||
event[FIELDS[ind]] = event[FIELDS[ind]].strip('\x00')
|
||||
for ind, field in enumerate(FIELDS):
|
||||
event[field] = pack[ind]
|
||||
if isinstance(event[field], str):
|
||||
event[field] = event[field].strip('\x00')
|
||||
ret.append(event)
|
||||
return ret
|
||||
|
|
|
@ -781,7 +781,7 @@ class Single(object):
|
|||
fsclient=self.fsclient,
|
||||
minion_opts=self.minion_opts,
|
||||
**self.target)
|
||||
opts_pkg = pre_wrapper['test.opts_pkg']()
|
||||
opts_pkg = pre_wrapper['test.opts_pkg']() # pylint: disable=E1102
|
||||
opts_pkg['file_roots'] = self.opts['file_roots']
|
||||
opts_pkg['pillar_roots'] = self.opts['pillar_roots']
|
||||
opts_pkg['ext_pillar'] = self.opts['ext_pillar']
|
||||
|
|
|
@ -140,7 +140,7 @@ def main(argv): # pylint: disable=W0613
|
|||
# Salt thin now is available to use
|
||||
else:
|
||||
scpstat = subprocess.Popen(['/bin/sh', '-c', 'command -v scp']).wait()
|
||||
if not scpstat == 0:
|
||||
if scpstat != 0:
|
||||
sys.exit(EX_SCP_NOT_FOUND)
|
||||
|
||||
if not os.path.exists(OPTIONS.saltdir):
|
||||
|
|
|
@ -196,7 +196,7 @@ def query_instance(vm_=None, call=None):
|
|||
|
||||
if isinstance(data, dict) and 'error' in data:
|
||||
log.warn(
|
||||
'There was an error in the query {0}'.format(data['error']) # pylint: disable=E1126
|
||||
'There was an error in the query. {0}'.format(data.get('error'))
|
||||
)
|
||||
# Trigger a failure in the wait for IP function
|
||||
return False
|
||||
|
|
|
@ -857,7 +857,7 @@ def _format_instance_info_select(vm, selection):
|
|||
|
||||
if 'files' in selection:
|
||||
file_full_info = {}
|
||||
if "layoutEx.file" in file:
|
||||
if "layoutEx.file" in file: # pylint: disable=E1135
|
||||
for file in vm["layoutEx.file"]:
|
||||
file_full_info[file.key] = {
|
||||
'key': file.key,
|
||||
|
|
|
@ -1199,7 +1199,7 @@ def session_create(consul_url=None, **kwargs):
|
|||
if str(_ttl).endswith('s'):
|
||||
_ttl = _ttl[:-1]
|
||||
|
||||
if not int(_ttl) >= 0 and not int(_ttl) <= 3600:
|
||||
if int(_ttl) < 0 or int(_ttl) > 3600:
|
||||
ret['message'] = ('TTL must be ',
|
||||
'between 0 and 3600.')
|
||||
ret['res'] = False
|
||||
|
|
|
@ -1221,7 +1221,7 @@ def _validate_input(kwargs,
|
|||
kwargs['memory_swap'] = \
|
||||
salt.utils.human_size_to_bytes(kwargs['memory_swap'])
|
||||
except ValueError:
|
||||
if kwargs['memory_swap'] in -1:
|
||||
if kwargs['memory_swap'] == -1:
|
||||
# memory_swap of -1 means swap is disabled
|
||||
return
|
||||
raise SaltInvocationError(
|
||||
|
|
|
@ -298,7 +298,7 @@ def __process_tokens_internal(tokens, start_at=0):
|
|||
log.debug(" TYPE: ASSIGNMENT")
|
||||
is_assignment = True
|
||||
else:
|
||||
raise CommandExecutionError('Unknown token!', 'Token:'+token)
|
||||
raise CommandExecutionError('Unknown token! Token: {0}'.format(token))
|
||||
|
||||
token_no = token_no + 1
|
||||
|
||||
|
@ -342,7 +342,7 @@ def __is_long(token):
|
|||
|
||||
def __get_long(token):
|
||||
if six.PY2:
|
||||
return long(token[0:-1]) # pylint: disable=incompatible-py3-code
|
||||
return long(token[0:-1])
|
||||
else:
|
||||
return int(token[0:-1])
|
||||
|
||||
|
|
|
@ -3021,7 +3021,7 @@ def update_lxc_conf(name, lxc_conf, lxc_conf_unset, path=None):
|
|||
({line[0]: line[1:]}, {key: item}))
|
||||
break
|
||||
if not matched:
|
||||
if not (key, item) in lines:
|
||||
if (key, item) not in lines:
|
||||
lines.append((key, item))
|
||||
changes['added'].append({key: item})
|
||||
dest_lxc_conf = []
|
||||
|
|
|
@ -30,7 +30,7 @@ except ImportError:
|
|||
|
||||
def __virtual__():
|
||||
if not HAS_PSUTIL:
|
||||
return False
|
||||
return False, 'The ps module cannot be loaded: python module psutil not installed.'
|
||||
|
||||
# Functions and attributes used in this execution module seem to have been
|
||||
# added as of psutil 0.3.0, from an inspection of the source code. Only
|
||||
|
@ -41,7 +41,7 @@ def __virtual__():
|
|||
# as of Dec. 2013 EPEL is on 0.6.1, Debian 7 is on 0.5.1, etc.).
|
||||
if psutil.version_info >= (0, 3, 0):
|
||||
return True
|
||||
return False
|
||||
return False, 'The ps module cannot be loaded: psutil must be version 0.3.0 or greater.'
|
||||
|
||||
|
||||
def _get_proc_cmdline(proc):
|
||||
|
|
|
@ -79,9 +79,9 @@ def doc(*args):
|
|||
else:
|
||||
target_mod = ''
|
||||
if _use_fnmatch:
|
||||
for fun in fnmatch.filter(__salt__.keys(), target_mod): # pylint: disable=incompatible-py3-code
|
||||
docs[fun] = __salt__[fun].__doc__ # There's no problem feeding fnmatch.filter()
|
||||
else: # with a Py3's dict_keys() instance
|
||||
for fun in fnmatch.filter(__salt__.keys(), target_mod):
|
||||
docs[fun] = __salt__[fun].__doc__
|
||||
else:
|
||||
|
||||
for fun in __salt__:
|
||||
if fun == module or fun.startswith(target_mod):
|
||||
|
@ -313,9 +313,8 @@ def renderer_doc(*args):
|
|||
|
||||
for module in args:
|
||||
if '*' in module:
|
||||
for fun in fnmatch.filter(renderers_.keys(), module): # pylint: disable=incompatible-py3-code
|
||||
docs[fun] = renderers_[fun].__doc__ # There's no problem feeding fnmatch.filter()
|
||||
# with a Py3's dict_keys() instance
|
||||
for fun in fnmatch.filter(renderers_.keys(), module):
|
||||
docs[fun] = renderers_[fun].__doc__
|
||||
else:
|
||||
for fun in six.iterkeys(renderers_):
|
||||
docs[fun] = renderers_[fun].__doc__
|
||||
|
@ -745,9 +744,9 @@ def list_returners(*args):
|
|||
return sorted(returners)
|
||||
|
||||
for module in args:
|
||||
for func in fnmatch.filter(returners_.keys(), module): # pylint: disable=incompatible-py3-code
|
||||
comps = func.split('.') # There's no problem feeding fnmatch.filter()
|
||||
if len(comps) < 2: # with a Py3's dict_keys() instance
|
||||
for func in fnmatch.filter(returners_.keys(), module):
|
||||
comps = func.split('.')
|
||||
if len(comps) < 2:
|
||||
continue
|
||||
returners.add(comps[0])
|
||||
return sorted(returners)
|
||||
|
|
|
@ -180,8 +180,9 @@ def create_event(message_type=None, routing_key='everybody', **kwargs):
|
|||
timestamp = datetime.datetime.strptime(kwargs['timestamp'], timestamp_fmt)
|
||||
data['timestamp'] = int(time.mktime(timestamp.timetuple()))
|
||||
except (TypeError, ValueError):
|
||||
raise SaltInvocationError('Date string could not be parsed: %s, %s',
|
||||
kwargs['timestamp'], timestamp_fmt)
|
||||
raise SaltInvocationError('Date string could not be parsed: {0}, {1}'.format(
|
||||
kwargs['timestamp'], timestamp_fmt)
|
||||
)
|
||||
|
||||
if 'state_start_time' in kwargs:
|
||||
state_start_time_fmt = kwargs.get('state_start_time_fmt', '%Y-%m-%dT%H:%M:%S')
|
||||
|
@ -190,8 +191,9 @@ def create_event(message_type=None, routing_key='everybody', **kwargs):
|
|||
state_start_time = datetime.datetime.strptime(kwargs['state_start_time'], state_start_time_fmt)
|
||||
data['state_start_time'] = int(time.mktime(state_start_time.timetuple()))
|
||||
except (TypeError, ValueError):
|
||||
raise SaltInvocationError('Date string could not be parsed: %s, %s',
|
||||
kwargs['state_start_time'], state_start_time_fmt)
|
||||
raise SaltInvocationError('Date string could not be parsed: {0}, {1}'.format(
|
||||
kwargs['state_start_time'], state_start_time_fmt)
|
||||
)
|
||||
|
||||
for kwarg in keyword_args:
|
||||
if kwarg in kwargs:
|
||||
|
|
|
@ -864,7 +864,7 @@ def remove(name=None, pkgs=None, version=None, **kwargs):
|
|||
else:
|
||||
if not version_num == old.get(target) \
|
||||
and not old.get(target) == "Not Found" \
|
||||
and not version_num == 'latest':
|
||||
and version_num != 'latest':
|
||||
log.error('{0} {1} not installed'.format(target, version))
|
||||
ret[target] = {'current': '{0} not installed'.format(version_num)}
|
||||
continue
|
||||
|
|
|
@ -77,7 +77,7 @@ def _is_zypper_error(retcode):
|
|||
Otherwise False
|
||||
'''
|
||||
# see man zypper for existing exit codes
|
||||
return not int(retcode) in [0, 100, 101, 102, 103]
|
||||
return int(retcode) not in [0, 100, 101, 102, 103]
|
||||
|
||||
|
||||
def _zypper_check_result(result, xml=False):
|
||||
|
@ -326,7 +326,7 @@ def upgrade_available(name):
|
|||
|
||||
salt '*' pkg.upgrade_available <package name>
|
||||
'''
|
||||
return not not latest_version(name)
|
||||
return latest_version(name)
|
||||
|
||||
|
||||
def version(*names, **kwargs):
|
||||
|
|
|
@ -152,7 +152,7 @@ class Serial(object):
|
|||
for idx, entry in enumerate(obj):
|
||||
obj[idx] = verylong_encoder(entry)
|
||||
return obj
|
||||
if six.PY2 and isinstance(obj, long) and long > pow(2, 64): # pylint: disable=incompatible-py3-code
|
||||
if six.PY2 and isinstance(obj, long) and long > pow(2, 64):
|
||||
return str(obj)
|
||||
elif six.PY3 and isinstance(obj, int) and int > pow(2, 64):
|
||||
return str(obj)
|
||||
|
@ -211,7 +211,7 @@ class Serial(object):
|
|||
return obj
|
||||
return obj
|
||||
return msgpack.dumps(odict_encoder(msg))
|
||||
except (SystemError, TypeError) as exc:
|
||||
except (SystemError, TypeError) as exc: # pylint: disable=W0705
|
||||
log.critical('Unable to serialize message! Consider upgrading msgpack. '
|
||||
'Message which failed was {failed_message} '
|
||||
'with exception {exception_message}').format(msg, exc)
|
||||
|
|
|
@ -37,6 +37,7 @@ from distutils.version import StrictVersion # pylint: disable=no-name-in-module
|
|||
try:
|
||||
import boto.ec2
|
||||
import boto.utils
|
||||
import boto.exception
|
||||
HAS_BOTO = True
|
||||
except ImportError:
|
||||
HAS_BOTO = False
|
||||
|
@ -123,7 +124,7 @@ def ext_pillar(minion_id,
|
|||
|
||||
try:
|
||||
conn = boto.ec2.connect_to_region(region)
|
||||
except boto.exception as e:
|
||||
except boto.exception as e: # pylint: disable=E0712
|
||||
log.error("%s: invalid AWS credentials.", __name__)
|
||||
return None
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ def execution():
|
|||
for v in six.itervalues(ret):
|
||||
docs.update(v)
|
||||
except SaltClientError as exc:
|
||||
print(exc) # pylint: disable=W1698
|
||||
print(exc)
|
||||
return []
|
||||
|
||||
i = itertools.chain.from_iterable([six.iteritems(docs['ret'])])
|
||||
|
|
|
@ -390,7 +390,7 @@ Dumper.add_multi_representer(type(None), Dumper.represent_none)
|
|||
if six.PY2:
|
||||
Dumper.add_multi_representer(six.binary_type, Dumper.represent_str)
|
||||
Dumper.add_multi_representer(six.text_type, Dumper.represent_unicode)
|
||||
Dumper.add_multi_representer(long, Dumper.represent_long) # pylint: disable=incompatible-py3-code
|
||||
Dumper.add_multi_representer(long, Dumper.represent_long)
|
||||
else:
|
||||
Dumper.add_multi_representer(six.binary_type, Dumper.represent_binary)
|
||||
Dumper.add_multi_representer(six.text_type, Dumper.represent_str)
|
||||
|
|
|
@ -184,7 +184,7 @@ def datasource_exists(name, jboss_config, datasource_properties, recreate=False)
|
|||
ret['result'] = False
|
||||
ret['comment'] = 'Could not create datasource. Stdout: '+create_result['stdout']
|
||||
else:
|
||||
raise CommandExecutionError('Unable to handle error', ds_result['failure-description'])
|
||||
raise CommandExecutionError('Unable to handle error: {0}'.format(ds_result['failure-description']))
|
||||
|
||||
if ret['result']:
|
||||
log.debug("ds_new_properties=%s", str(ds_new_properties))
|
||||
|
|
|
@ -43,4 +43,7 @@ class LocalChannel(ReqChannel):
|
|||
return ret
|
||||
|
||||
def crypted_transfer_decode_dictentry(self, load, dictkey=None, tries=3, timeout=60):
|
||||
super(LocalChannel, self).crypted_transfer_decode_dictentry()
|
||||
super(LocalChannel, self).crypted_transfer_decode_dictentry(load,
|
||||
dictkey=dictkey,
|
||||
tries=tries,
|
||||
timeout=timeout)
|
||||
|
|
|
@ -1845,7 +1845,7 @@ def rm_rf(path):
|
|||
os.chmod(path, stat.S_IWUSR)
|
||||
func(path)
|
||||
else:
|
||||
raise
|
||||
raise # pylint: disable=E0704
|
||||
|
||||
shutil.rmtree(path, onerror=_onerror)
|
||||
|
||||
|
@ -2030,7 +2030,7 @@ def alias_function(fun, name, doc=None):
|
|||
if six.PY3:
|
||||
orig_name = fun.__name__
|
||||
else:
|
||||
orig_name = fun.func_name # pylint: disable=incompatible-py3-code
|
||||
orig_name = fun.func_name
|
||||
|
||||
alias_msg = ('\nThis function is an alias of '
|
||||
'``{0}``.\n'.format(orig_name))
|
||||
|
@ -2809,7 +2809,7 @@ def to_str(s, encoding=None):
|
|||
else:
|
||||
if isinstance(s, bytearray):
|
||||
return str(s)
|
||||
if isinstance(s, unicode): # pylint: disable=incompatible-py3-code
|
||||
if isinstance(s, unicode):
|
||||
return s.encode(encoding or __salt_system_encoding__)
|
||||
raise TypeError('expected str, bytearray, or unicode')
|
||||
|
||||
|
@ -2840,7 +2840,7 @@ def to_unicode(s, encoding=None):
|
|||
else:
|
||||
if isinstance(s, str):
|
||||
return s.decode(encoding or __salt_system_encoding__)
|
||||
return unicode(s) # pylint: disable=incompatible-py3-code
|
||||
return unicode(s)
|
||||
|
||||
|
||||
def is_list(value):
|
||||
|
|
|
@ -27,7 +27,7 @@ def condition_input(args, kwargs):
|
|||
# XXX: We might need to revisit this code when we move to Py3
|
||||
# since long's are int's in Py3
|
||||
if (six.PY3 and isinstance(arg, six.integer_types)) or \
|
||||
(six.PY2 and isinstance(arg, long)): # pylint: disable=incompatible-py3-code
|
||||
(six.PY2 and isinstance(arg, long)):
|
||||
ret.append(str(arg))
|
||||
else:
|
||||
ret.append(arg)
|
||||
|
|
|
@ -38,7 +38,7 @@ def deepcopy_bound(name):
|
|||
|
||||
'''
|
||||
def _deepcopy_method(x, memo):
|
||||
return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class) # pylint: disable=W1699
|
||||
return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class)
|
||||
try:
|
||||
pre_dispatch = copy._deepcopy_dispatch
|
||||
copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method
|
||||
|
|
|
@ -279,7 +279,7 @@ except ImportError:
|
|||
|
||||
'''
|
||||
if isinstance(other, OrderedDict):
|
||||
return len(self) == len(other) and self.items() == other.items() # pylint: disable=incompatible-py3-code
|
||||
return len(self) == len(other) and self.items() == other.items()
|
||||
return dict.__eq__(self, other)
|
||||
|
||||
def __ne__(self, other):
|
||||
|
@ -327,7 +327,7 @@ class DefaultOrderedDict(OrderedDict):
|
|||
args = tuple()
|
||||
else:
|
||||
args = self.default_factory,
|
||||
return type(self), args, None, None, self.items() # pylint: disable=incompatible-py3-code
|
||||
return type(self), args, None, None, self.items()
|
||||
|
||||
def copy(self):
|
||||
return self.__copy__()
|
||||
|
@ -338,7 +338,7 @@ class DefaultOrderedDict(OrderedDict):
|
|||
def __deepcopy__(self):
|
||||
import copy
|
||||
return type(self)(self.default_factory,
|
||||
copy.deepcopy(self.items())) # pylint: disable=incompatible-py3-code
|
||||
copy.deepcopy(self.items()))
|
||||
|
||||
def __repr__(self, _repr_running={}): # pylint: disable=W0102
|
||||
return 'DefaultOrderedDict({0}, {1})'.format(self.default_factory,
|
||||
|
|
|
@ -549,7 +549,7 @@ class Schema(six.with_metaclass(SchemaMeta, object)):
|
|||
cls.after_items_update = []
|
||||
for name in cls._order:
|
||||
skip_order = False
|
||||
if name in cls._sections:
|
||||
if name in cls._sections: # pylint: disable=E1135
|
||||
section = cls._sections[name]
|
||||
serialized_section = section.serialize(None if section.__flatten__ is True else name)
|
||||
if section.__flatten__ is True:
|
||||
|
@ -567,7 +567,7 @@ class Schema(six.with_metaclass(SchemaMeta, object)):
|
|||
# Store it as a configuration section
|
||||
properties[name] = serialized_section
|
||||
|
||||
if name in cls._items:
|
||||
if name in cls._items: # pylint: disable=E1135
|
||||
config = cls._items[name]
|
||||
# Handle the configuration items defined in the class instance
|
||||
if config.__flatten__ is True:
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
Set up the version of Salt
|
||||
'''
|
||||
|
||||
# pylint: disable=incompatible-py3-code
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, print_function
|
||||
import re
|
||||
|
|
|
@ -39,9 +39,7 @@ class CopyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
if not line:
|
||||
continue
|
||||
data = yaml.load(line)
|
||||
minions.extend(data.keys()) # pylint: disable=incompatible-py3-code
|
||||
# since we're extending a list, the Py3 dict_keys view will behave
|
||||
# as expected.
|
||||
minions.extend(data.keys())
|
||||
|
||||
self.assertNotEqual(minions, [])
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ class PCAPParser(object):
|
|||
'tcp': {}
|
||||
}
|
||||
|
||||
(header, packet) = cap.next() # pylint: disable=W1699
|
||||
(header, packet) = cap.next()
|
||||
|
||||
eth_length, eth_protocol = self.parse_ether(packet)
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class EtcdModTestCase(TestCase):
|
|||
if key == '':
|
||||
raise KeyError
|
||||
elif key == 'err':
|
||||
raise
|
||||
raise ValueError
|
||||
return MockEtcd
|
||||
|
||||
with patch.object(etcd_util, 'get_conn',
|
||||
|
@ -66,7 +66,7 @@ class EtcdModTestCase(TestCase):
|
|||
|
||||
self.assertEqual(etcd_mod.get_(''), '')
|
||||
|
||||
self.assertRaises(Exception, etcd_mod.get_, 'err')
|
||||
self.assertRaises(ValueError, etcd_mod.get_, 'err')
|
||||
|
||||
# 'set_' function tests: 1
|
||||
|
||||
|
@ -93,7 +93,7 @@ class EtcdModTestCase(TestCase):
|
|||
if key == '':
|
||||
raise KeyError
|
||||
elif key == 'err':
|
||||
raise
|
||||
raise ValueError
|
||||
return MockEtcd
|
||||
|
||||
with patch.object(etcd_util, 'get_conn',
|
||||
|
@ -102,7 +102,7 @@ class EtcdModTestCase(TestCase):
|
|||
|
||||
self.assertEqual(etcd_mod.set_('', 'stack'), '')
|
||||
|
||||
self.assertRaises(Exception, etcd_mod.set_, 'err', 'stack')
|
||||
self.assertRaises(ValueError, etcd_mod.set_, 'err', 'stack')
|
||||
|
||||
# 'ls_' function tests: 1
|
||||
|
||||
|
@ -127,7 +127,7 @@ class EtcdModTestCase(TestCase):
|
|||
if path == '':
|
||||
raise KeyError
|
||||
elif path == 'err':
|
||||
raise
|
||||
raise ValueError
|
||||
return MockEtcd
|
||||
|
||||
with patch.object(etcd_util, 'get_conn',
|
||||
|
@ -136,7 +136,7 @@ class EtcdModTestCase(TestCase):
|
|||
|
||||
self.assertDictEqual(etcd_mod.ls_(''), {})
|
||||
|
||||
self.assertRaises(Exception, etcd_mod.ls_, 'err')
|
||||
self.assertRaises(ValueError, etcd_mod.ls_, 'err')
|
||||
|
||||
# 'rm_' function tests: 1
|
||||
|
||||
|
@ -163,7 +163,7 @@ class EtcdModTestCase(TestCase):
|
|||
if key == '':
|
||||
raise KeyError
|
||||
elif key == 'err':
|
||||
raise
|
||||
raise ValueError
|
||||
if recursive:
|
||||
return True
|
||||
else:
|
||||
|
@ -178,7 +178,7 @@ class EtcdModTestCase(TestCase):
|
|||
|
||||
self.assertFalse(etcd_mod.rm_(''))
|
||||
|
||||
self.assertRaises(Exception, etcd_mod.rm_, 'err')
|
||||
self.assertRaises(ValueError, etcd_mod.rm_, 'err')
|
||||
|
||||
# 'tree' function tests: 1
|
||||
|
||||
|
|
|
@ -1840,7 +1840,7 @@ class ConfigTestCase(TestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
item.serialize(), {
|
||||
'anyOf': [i.serialize() for i in item.items]
|
||||
'anyOf': [i.serialize() for i in item.items] # pylint: disable=E1133
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -1892,7 +1892,7 @@ class ConfigTestCase(TestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
item.serialize(), {
|
||||
'allOf': [i.serialize() for i in item.items]
|
||||
'allOf': [i.serialize() for i in item.items] # pylint: disable=E1133
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue