Hello community, here is the log from the commit of package python-salt-testing for openSUSE:Factory checked in at 2015-10-17 16:39:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-salt-testing (Old) and /work/SRC/openSUSE:Factory/.python-salt-testing.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-salt-testing" Changes: -------- --- /work/SRC/openSUSE:Factory/python-salt-testing/python-salt-testing.changes 2015-02-13 08:35:39.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-salt-testing.new/python-salt-testing.changes 2015-10-17 16:39:05.000000000 +0200 @@ -1,0 +2,7 @@ +Tue Oct 13 14:02:31 UTC 2015 - tampak...@opensuse.org + +- Update to 2015.7.10 + - introduces new dependency to python-six + - No changelog, see https://github.com/saltstack/salt-testing/compare/v2015.2.16...v2015.7.10 + +------------------------------------------------------------------- Old: ---- SaltTesting-2015.2.16.tar.gz New: ---- SaltTesting-2015.7.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-salt-testing.spec ++++++ --- /var/tmp/diff_new_pack.sc3gYO/_old 2015-10-17 16:39:06.000000000 +0200 +++ /var/tmp/diff_new_pack.sc3gYO/_new 2015-10-17 16:39:06.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-salt-testing # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-salt-testing -Version: 2015.2.16 +Version: 2015.7.10 Release: 0 Summary: Testing tools needed in the several Salt Stack projects License: Apache-2.0 @@ -29,12 +29,13 @@ BuildRequires: fdupes BuildRequires: python-devel BuildRequires: python-mock +BuildRequires: python-requests BuildRequires: python-setuptools BuildRequires: python-unittest2 -BuildRequires: python-requests Requires: python-mock -Requires: python-unittest2 Requires: python-requests +Requires: python-six +Requires: python-unittest2 Recommends: python-coverage %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} ++++++ SaltTesting-2015.2.16.tar.gz -> SaltTesting-2015.7.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/MANIFEST.in new/SaltTesting-2015.7.10/MANIFEST.in --- old/SaltTesting-2015.2.16/MANIFEST.in 2015-02-12 18:26:57.000000000 +0100 +++ new/SaltTesting-2015.7.10/MANIFEST.in 2015-07-10 18:40:09.000000000 +0200 @@ -1 +1,2 @@ graft salttesting/_saltconf/* +exclude salttesting/pylintplugins/flask_sqlalchemy_transform.py salttesting/pylintplugins/string_format.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/PKG-INFO new/SaltTesting-2015.7.10/PKG-INFO --- old/SaltTesting-2015.2.16/PKG-INFO 2015-02-12 18:29:57.000000000 +0100 +++ new/SaltTesting-2015.7.10/PKG-INFO 2015-07-10 18:42:59.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: SaltTesting -Version: 2015.2.16 +Version: 2015.7.10 Summary: Required testing tools needed in the several SaltStack projects. Home-page: https://github.com/saltstack/salt-testing Author: Pedro Algarvio diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/SaltTesting.egg-info/PKG-INFO new/SaltTesting-2015.7.10/SaltTesting.egg-info/PKG-INFO --- old/SaltTesting-2015.2.16/SaltTesting.egg-info/PKG-INFO 2015-02-12 18:29:54.000000000 +0100 +++ new/SaltTesting-2015.7.10/SaltTesting.egg-info/PKG-INFO 2015-07-10 18:42:55.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: SaltTesting -Version: 2015.2.16 +Version: 2015.7.10 Summary: Required testing tools needed in the several SaltStack projects. Home-page: https://github.com/saltstack/salt-testing Author: Pedro Algarvio diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/SaltTesting.egg-info/SOURCES.txt new/SaltTesting-2015.7.10/SaltTesting.egg-info/SOURCES.txt --- old/SaltTesting-2015.2.16/SaltTesting.egg-info/SOURCES.txt 2015-02-12 18:29:54.000000000 +0100 +++ new/SaltTesting-2015.7.10/SaltTesting.egg-info/SOURCES.txt 2015-07-10 18:42:55.000000000 +0200 @@ -46,11 +46,9 @@ salttesting/parser/cover.py salttesting/pylintplugins/__init__.py salttesting/pylintplugins/fileperms.py -salttesting/pylintplugins/flask_sqlalchemy_transform.py salttesting/pylintplugins/pep263.py salttesting/pylintplugins/pep8.py salttesting/pylintplugins/smartup.py -salttesting/pylintplugins/string_format.py salttesting/pylintplugins/strings.py salttesting/pylintplugins/py3modernize/__init__.py salttesting/pylintplugins/py3modernize/fixes/__init__.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/SaltTesting.egg-info/requires.txt new/SaltTesting-2015.7.10/SaltTesting.egg-info/requires.txt --- old/SaltTesting-2015.2.16/SaltTesting.egg-info/requires.txt 2015-02-12 18:29:54.000000000 +0100 +++ new/SaltTesting-2015.7.10/SaltTesting.egg-info/requires.txt 2015-07-10 18:42:55.000000000 +0200 @@ -1,3 +1,4 @@ +six [GitHub] requests>=2.4.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/__init__.py new/SaltTesting-2015.7.10/salttesting/__init__.py --- old/SaltTesting-2015.2.16/salttesting/__init__.py 2014-05-28 09:59:03.000000000 +0200 +++ new/SaltTesting-2015.7.10/salttesting/__init__.py 2015-05-06 11:10:00.000000000 +0200 @@ -12,6 +12,7 @@ ''' # Import python libs +from __future__ import absolute_import import warnings # Import salt-testing libs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/case.py new/SaltTesting-2015.7.10/salttesting/case.py --- old/SaltTesting-2015.2.16/salttesting/case.py 2015-02-12 18:29:04.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/case.py 2015-05-06 11:04:53.000000000 +0200 @@ -12,6 +12,7 @@ ''' # Import python libs +from __future__ import absolute_import import os import re import sys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/cherrypytest/base.py new/SaltTesting-2015.7.10/salttesting/cherrypytest/base.py --- old/SaltTesting-2015.2.16/salttesting/cherrypytest/base.py 2014-09-10 23:29:06.000000000 +0200 +++ new/SaltTesting-2015.7.10/salttesting/cherrypytest/base.py 2015-05-06 11:39:14.000000000 +0200 @@ -28,6 +28,7 @@ # Modified from the original. See the Git history of this file for details. # https://bitbucket.org/Lawouach/cherrypy-recipes/src/50aff88dc4e24206518ec32e1c32af043f2729da/testing/unit/serverless/cptestcase.py +from __future__ import absolute_import, print_function from StringIO import StringIO import cherrypy @@ -111,7 +112,7 @@ fd = None if response.output_status.startswith('500'): - print response.body + print(response.body) raise AssertionError("Unexpected error") # collapse the response into a bytestring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/cherrypytest/case.py new/SaltTesting-2015.7.10/salttesting/cherrypytest/case.py --- old/SaltTesting-2015.2.16/salttesting/cherrypytest/case.py 2014-10-22 14:20:04.000000000 +0200 +++ new/SaltTesting-2015.7.10/salttesting/cherrypytest/case.py 2015-05-06 11:37:52.000000000 +0200 @@ -1,5 +1,5 @@ # coding: utf-8 - +from __future__ import absolute_import try: import cherrypy HAS_CHERRYPY = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/ext/console.py new/SaltTesting-2015.7.10/salttesting/ext/console.py --- old/SaltTesting-2015.2.16/salttesting/ext/console.py 2013-11-12 06:14:36.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/ext/console.py 2015-05-06 11:35:50.000000000 +0200 @@ -8,6 +8,7 @@ ''' # Import python libs +from __future__ import absolute_import, print_function import os import platform import struct @@ -31,7 +32,6 @@ current_os.startswith('CYGWIN'): tuple_xy = _getTerminalSize_linux() if tuple_xy is None: - print 'default' tuple_xy = (80, 25) # default value return tuple_xy @@ -105,4 +105,4 @@ if __name__ == '__main__': sizex, sizey = getTerminalSize() - print 'width =', sizex, 'height =', sizey + print('width = {0} height = {1}'.format(sizex, sizey)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/ext/os_data.py new/SaltTesting-2015.7.10/salttesting/ext/os_data.py --- old/SaltTesting-2015.2.16/salttesting/ext/os_data.py 2013-11-12 06:14:36.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/ext/os_data.py 2015-05-06 11:03:30.000000000 +0200 @@ -2,6 +2,7 @@ This file was copied and adapted from salt's source code ''' +from __future__ import absolute_import import os import re import sys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/github.py new/SaltTesting-2015.7.10/salttesting/github.py --- old/SaltTesting-2015.2.16/salttesting/github.py 2014-12-13 14:47:20.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/github.py 2015-05-06 10:58:38.000000000 +0200 @@ -10,6 +10,7 @@ ''' # Import Python Libs +from __future__ import absolute_import import os import argparse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/helpers.py new/SaltTesting-2015.7.10/salttesting/helpers.py --- old/SaltTesting-2015.2.16/salttesting/helpers.py 2014-12-13 01:04:26.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/helpers.py 2015-05-07 17:08:54.000000000 +0200 @@ -12,19 +12,26 @@ ''' # Import Python libs +from __future__ import absolute_import import os import sys import types import socket import inspect import logging -import __builtin__ from functools import wraps # Import Salt Testing libs from salttesting import __version_info__ from salttesting.unit import skip, _id +# Import 3rd-party libs +import six +if sys.version_info < (3,): + import __builtin__ # pylint: disable=incompatible-py3-code +else: + import builtins as __builtin__ # pylint: disable=import-error + log = logging.getLogger(__name__) @@ -669,7 +676,7 @@ ) if failure is not None: # If an exception was thrown, raise it - raise failure[0], failure[1], failure[2] + six.reraise(failure[0], failure[1], failure[2]) return wrap return decorator @@ -771,7 +778,7 @@ ) if failure is not None: # If an exception was thrown, raise it - raise failure[0], failure[1], failure[2] + six.reraise(failure[0], failure[1], failure[2]) return wrap return decorator @@ -931,7 +938,7 @@ ) if failure is not None: # If an exception was thrown, raise it - raise failure[0], failure[1], failure[2] + six.reraise(failure[0], failure[1], failure[2]) return wrap return decorator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/jenkins.py new/SaltTesting-2015.7.10/salttesting/jenkins.py --- old/SaltTesting-2015.2.16/salttesting/jenkins.py 2015-01-07 03:47:32.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/jenkins.py 2015-05-06 10:59:16.000000000 +0200 @@ -10,7 +10,7 @@ ''' # Import python libs -from __future__ import print_function +from __future__ import absolute_import, print_function import os import sys import json @@ -167,8 +167,17 @@ ''' Generate a random enough vm name ''' - if 'BUILD_NUMBER' in os.environ: - random_part = 'build{0:0>6}'.format(os.environ.get('BUILD_NUMBER')) + vm_name_prefix = os.environ.get('JENKINS_VM_NAME_PREFIX', 'Z') + if 'BUILD_TAG' in os.environ: + return '{0}_{1}'.format( + vm_name_prefix, + os.environ.get('BUILD_TAG').replace( + 'jenkins', 'jk').replace( + 'salt-cloud', 'cloud').replace( + 'nightly', 'ntly').replace( + 'salt', 'slt').replace( + 'linode', 'lin') + ) else: random_part = hashlib.md5( str(random.randint(1, 100000000))).hexdigest()[:6] @@ -199,9 +208,9 @@ 'with_coverage': options.test_without_coverage is False } if options.test_git_commit is not None: - pillar['test_git_commit'] = options.test_git_commit + pillar['test_git_commit'] = pillar['repo_clone_rev'] = options.test_git_commit if options.test_git_url is not None: - pillar['test_git_url'] = options.test_git_url + pillar['test_git_url'] = pillar['repo_clone_url'] = options.test_git_url if options.bootstrap_salt_url is not None: pillar['bootstrap_salt_url'] = options.bootstrap_salt_url if options.bootstrap_salt_commit is not None: @@ -398,7 +407,7 @@ if 'salt_minion_bootstrapped' not in options: print_bulleted(options, 'Minion not boostrapped. Not grabbing external IP.', 'RED') sys.exit(1) - if 'minion_external_ip' in options: + if getattr(options, 'minion_external_ip', None): return options.minion_external_ip sync_minion(options) @@ -603,7 +612,7 @@ '-l', options.log_level, '--retcode-passthrough' ] - if options.bootstrapped_salt_minion_version > (2014, 7): + if options.bootstrapped_salt_minion_version >= (2015, 2): cmd.append('--timeout={0}'.format(timeout)) if options.no_color: cmd.append('--no-color') @@ -759,7 +768,7 @@ if not os.path.isdir(local_path): os.makedirs(local_path) run_command( - 'echo "get {0} {1}" | {2}'.format( + 'echo "get -r {0} {1}" | {2}'.format( remote_path, local_path, ' '.join(sftp_command) @@ -980,7 +989,12 @@ action='store_true', help='Run buildpackage.py to create packages off of the git build.' ) - # These next three options are ignored if --build-packages is False + # These next four options are ignored if --build-packages is False + packaging_options.add_argument( + '--build-packages-sls', + default='buildpackage', + help='The state to run for \'--build-packages\'. Default: %(default)s.' + ) packaging_options.add_argument( '--package-source-dir', default='/testing', @@ -1000,6 +1014,10 @@ ) options = parser.parse_args() + if options.echo_parseable_output and \ + os.path.exists(os.path.join(options.workspace, '.state.json')): + # Since this is the first command to run, let's clear any saved state + os.unlink(os.path.join(options.workspace, '.state.json')) load_state(options) if options.lxc_deploy or options.lxc_host: @@ -1103,7 +1121,7 @@ # If we reached here it means the test command passed, let's build # packages if the option is passed if options.build_packages: - run_state_on_vm(options, 'buildpackage') + run_state_on_vm(options, options.build_packages_sls) # Let's download the logs, even if building the packages fails logs_dir = os.path.join(options.workspace, 'logs') if not os.path.isdir(logs_dir): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/mixins.py new/SaltTesting-2015.7.10/salttesting/mixins.py --- old/SaltTesting-2015.2.16/salttesting/mixins.py 2014-11-11 21:40:02.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/mixins.py 2015-07-01 19:23:34.000000000 +0200 @@ -10,6 +10,7 @@ ''' # Import python libs +from __future__ import absolute_import import os import pprint import logging @@ -19,6 +20,9 @@ # Import Salt Testing Libs from salttesting.runtests import RUNTIME_VARS +# Import 3rd-party libs +import six + log = logging.getLogger(__name__) @@ -85,7 +89,7 @@ if isinstance(keys, tuple): # If it's a tuple, turn it into a list keys = list(keys) - elif isinstance(keys, basestring): + elif isinstance(keys, six.string_types): # If it's a basestring , make it a one item list keys = [keys] elif not isinstance(keys, list): @@ -318,9 +322,7 @@ self.client._check_pub_data({'jid': '0'}), 'Passing JID of zero is not handled gracefully') ''' - _salt_client_config_file_name_ = 'master' - __slots__ = ('client', '_salt_client_config_file_name_') @property def client(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/mock.py new/SaltTesting-2015.7.10/salttesting/mock.py --- old/SaltTesting-2015.2.16/salttesting/mock.py 2014-11-11 21:40:02.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/mock.py 2015-07-10 18:38:22.000000000 +0200 @@ -11,6 +11,7 @@ ''' from __future__ import absolute_import +import sys try: from mock import ( @@ -24,11 +25,19 @@ FILTER_DIR, NonCallableMock, NonCallableMagicMock, - mock_open, - PropertyMock + PropertyMock, + __version__ as __mock_version ) NO_MOCK = False NO_MOCK_REASON = '' + mock_version = [] + for __part in __mock_version.split('.'): + try: + mock_version.append(int(__part)) + except ValueError: + # Non-integer value (ex. '1a') + mock_version.append(__part) + mock_version = tuple(mock_version) except ImportError: NO_MOCK = True NO_MOCK_REASON = 'mock python module is unavailable' @@ -73,3 +82,85 @@ except ImportError: NO_MOCK = True NO_MOCK_REASON = 'you need to upgrade your mock version to >= 0.8.0' + + +if sys.version_info[0] >= 3: + from mock import mock_open +else: + # backport mock_open from the python 3 unittest.mock library so that we can + # mock read, readline, readlines, and file iteration properly + + file_spec = None + + def _iterate_read_data(read_data): + # Helper for mock_open: + # Retrieve lines from read_data via a generator so that separate calls to + # readline, read, and readlines are properly interleaved + data_as_list = ['{0}\n'.format(l) for l in read_data.split('\n')] + + if data_as_list[-1] == '\n': + # If the last line ended in a newline, the list comprehension will have an + # extra entry that's just a newline. Remove this. + data_as_list = data_as_list[:-1] + else: + # If there wasn't an extra newline by itself, then the file being + # emulated doesn't have a newline to end the last line remove the + # newline that our naive format() added + data_as_list[-1] = data_as_list[-1][:-1] + + for line in data_as_list: + yield line + + def mock_open(mock=None, read_data=''): + """ + A helper function to create a mock to replace the use of `open`. It works + for `open` called directly or used as a context manager. + + The `mock` argument is the mock object to configure. If `None` (the + default) then a `MagicMock` will be created for you, with the API limited + to methods or attributes available on standard file handles. + + `read_data` is a string for the `read` methoddline`, and `readlines` of the + file handle to return. This is an empty string by default. + """ + def _readlines_side_effect(*args, **kwargs): + if handle.readlines.return_value is not None: + return handle.readlines.return_value + return list(_data) + + def _read_side_effect(*args, **kwargs): + if handle.read.return_value is not None: + return handle.read.return_value + return ''.join(_data) + + def _readline_side_effect(): + if handle.readline.return_value is not None: + while True: + yield handle.readline.return_value + for line in _data: + yield line + + + global file_spec + if file_spec is None: + file_spec = file + + if mock is None: + mock = MagicMock(name='open', spec=open) + + handle = MagicMock(spec=file_spec) + handle.__enter__.return_value = handle + + _data = _iterate_read_data(read_data) + + handle.write.return_value = None + handle.read.return_value = None + handle.readline.return_value = None + handle.readlines.return_value = None + + handle.read.side_effect = _read_side_effect + handle.readline.side_effect = _readline_side_effect() + handle.readlines.side_effect = _readlines_side_effect + + mock.return_value = handle + return mock diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/parser/__init__.py new/SaltTesting-2015.7.10/salttesting/parser/__init__.py --- old/SaltTesting-2015.2.16/salttesting/parser/__init__.py 2014-11-11 21:40:02.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/parser/__init__.py 2015-05-06 11:23:12.000000000 +0200 @@ -10,6 +10,7 @@ :license: Apache 2.0, see LICENSE for more details. ''' +from __future__ import absolute_import, print_function import os import sys import time @@ -502,7 +503,7 @@ ''' Print a nicely formatted report about the test suite results ''' - print + print() print_header( u' Overall Tests Report ', sep=u'=', centered=True, inline=True, width=self.options.output_columns diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/parser/cover.py new/SaltTesting-2015.7.10/salttesting/parser/cover.py --- old/SaltTesting-2015.2.16/salttesting/parser/cover.py 2014-01-12 23:37:50.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/parser/cover.py 2015-05-06 11:22:08.000000000 +0200 @@ -11,6 +11,7 @@ ''' # Import python libs +from __future__ import absolute_import, print_function import os import re import sys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/fileperms.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/fileperms.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/fileperms.py 2014-12-16 13:16:33.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/fileperms.py 2015-05-06 11:19:24.000000000 +0200 @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- - +# ----- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------> +# This Pylint plugin is deprecated. Development continues on the SaltPyLint package +# <---- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------- +from __future__ import absolute_import import os import glob import stat diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/flask_sqlalchemy_transform.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/flask_sqlalchemy_transform.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/flask_sqlalchemy_transform.py 2014-01-06 17:18:17.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/flask_sqlalchemy_transform.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -''' - :codeauthor: :email:`Pedro Algarvio (pe...@algarvio.me)` - :copyright: © 2014 by the SaltStack Team, see AUTHORS for more details. - :license: Apache 2.0, see LICENSE for more details. - - - pylint_helpers - ~~~~~~~~~~~~~~ - - Help PyLint understand some of this projects parts -''' - -from astroid import MANAGER -from astroid import nodes -from astroid.builder import AstroidBuilder - - -def flask_sqlalchemy_transform(module): - if module.name != 'flask_sqlalchemy': - return - - import flask_sqlalchemy - flask_sqlalchemy._include_sqlalchemy(flask_sqlalchemy.SQLAlchemy) - - fake = AstroidBuilder(MANAGER).inspect_build(flask_sqlalchemy) - - for func_name, func in fake.locals.items(): - if func_name == 'SQLAlchemy': - func[0].Model = fake.locals['Model'][0] - module.locals[func_name] = func - - -def register(linter): - ''' - Allow this to be setup when loading the plugins - ''' - MANAGER.register_transform(nodes.Module, flask_sqlalchemy_transform) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/pep263.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/pep263.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/pep263.py 2014-11-22 09:54:56.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/pep263.py 2015-05-06 11:19:41.000000000 +0200 @@ -9,7 +9,10 @@ PEP-263 PyLint Checker ====================== ''' - +# ----- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------> +# This Pylint plugin is deprecated. Development continues on the SaltPyLint package +# <---- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------- +from __future__ import absolute_import import re import itertools diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/pep8.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/pep8.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/pep8.py 2014-11-13 00:27:37.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/pep8.py 2015-05-06 13:49:44.000000000 +0200 @@ -14,8 +14,9 @@ .. _`pep8`: http://pep8.readthedocs.org ''' - -# Let's use absolute imports +# ----- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------> +# This Pylint plugin is deprecated. Development continues on the SaltPyLint package +# <---- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------- from __future__ import absolute_import import sys import logging @@ -31,7 +32,7 @@ from pep8 import StyleGuide, BaseReport HAS_PEP8 = True except ImportError: - HAS_PEP8 = False + HAS_PEP8 = False warnings.warn( 'No pep8 library could be imported. No PEP8 check\'s will be done', RuntimeWarning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/py3modernize/__init__.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/py3modernize/__init__.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/py3modernize/__init__.py 2015-01-07 07:30:41.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/py3modernize/__init__.py 2015-05-06 11:21:12.000000000 +0200 @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- - +# ----- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------> +# This Pylint plugin is deprecated. Development continues on the SaltPyLint package +# <---- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------- +from __future__ import absolute_import import difflib import warnings import logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/smartup.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/smartup.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/smartup.py 2014-11-23 21:21:29.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/smartup.py 2015-05-06 11:20:12.000000000 +0200 @@ -13,8 +13,11 @@ understand some classed used in Salt which trigger, `no-member` and `maybe-no-member` A bridge between the `pep8`_ library and PyLint - ''' - +''' +# ----- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------> +# This Pylint plugin is deprecated. Development continues on the SaltPyLint package +# <---- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------- +from __future__ import absolute_import # Import PyLint libs from astroid import nodes, MANAGER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/string_format.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/string_format.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/string_format.py 2014-08-05 22:32:53.000000000 +0200 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/string_format.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,159 +0,0 @@ -# Copyright (c) 2009-2010 Arista Networks, Inc. - James Lingard -# Copyright (c) 2004-2010 LOGILAB S.A. (Paris, FRANCE). -# http://www.logilab.fr/ -- mailto:cont...@logilab.fr -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -"""Checker for string formatting operations. -""" - -import string -from logilab import astng -from pylint.interfaces import IASTNGChecker -from pylint.checkers import BaseChecker -from pylint.checkers import utils - - -MSGS = { - 'E1300': ("Unsupported format character %r (%#02x) at index %d", - "Used when a unsupported format character is used in a format\ - string."), - 'E1301': ("Format string ends in middle of conversion specifier", - "Used when a format string terminates before the end of a \ - conversion specifier."), - 'E1302': ("Mixing named and unnamed conversion specifiers in format string", - "Used when a format string contains both named (e.g. '%(foo)d') \ - and unnamed (e.g. '%d') conversion specifiers. This is also \ - used when a named conversion specifier contains * for the \ - minimum field width and/or precision."), - 'E1303': ("Expected mapping for format string, not %s", - "Used when a format string that uses named conversion specifiers \ - is used with an argument that is not a mapping."), - 'W1300': ("Format string dictionary key should be a string, not %s", - "Used when a format string that uses named conversion specifiers \ - is used with a dictionary whose keys are not all strings."), - 'W1301': ("Unused key %r in format string dictionary", - "Used when a format string that uses named conversion specifiers \ - is used with a dictionary that conWtains keys not required by the \ - format string."), - 'E1304': ("Missing key %r in format string dictionary", - "Used when a format string that uses named conversion specifiers \ - is used with a dictionary that doesn't contain all the keys \ - required by the format string."), - 'E1305': ("Too many arguments for format string", - "Used when a format string that uses unnamed conversion \ - specifiers is given too few arguments."), - 'E1306': ("Not enough arguments for format string", - "Used when a format string that uses unnamed conversion \ - specifiers is given too many arguments"), - } - -OTHER_NODES = (astng.Const, astng.List, astng.Backquote, - astng.Lambda, astng.Function, - astng.ListComp, astng.SetComp, astng.GenExpr) - -class StringFormatChecker(BaseChecker): - """Checks string formatting operations to ensure that the format string - is valid and the arguments match the format string. - """ - - __implements__ = (IASTNGChecker,) - name = 'string_format' - msgs = MSGS - - def visit_binop(self, node): - if node.op != '%': - return - left = node.left - args = node.right - - if not (isinstance(left, astng.Const) - and isinstance(left.value, basestring)): - return - format_string = left.value - try: - required_keys, required_num_args = \ - utils.parse_format_string(format_string) - except utils.UnsupportedFormatCharacter, e: - c = format_string[e.index] - self.add_message('E1300', node=node, args=(c, ord(c), e.index)) - return - except utils.IncompleteFormatString: - self.add_message('E1301', node=node) - return - if required_keys and required_num_args: - # The format string uses both named and unnamed format - # specifiers. - self.add_message('E1302', node=node) - elif required_keys: - # The format string uses only named format specifiers. - # Check that the RHS of the % operator is a mapping object - # that contains precisely the set of keys required by the - # format string. - if isinstance(args, astng.Dict): - keys = set() - unknown_keys = False - for k, v in args.items: - if isinstance(k, astng.Const): - key = k.value - if isinstance(key, basestring): - keys.add(key) - else: - self.add_message('W1300', node=node, args=key) - else: - # One of the keys was something other than a - # constant. Since we can't tell what it is, - # supress checks for missing keys in the - # dictionary. - unknown_keys = True - if not unknown_keys: - for key in required_keys: - if key not in keys: - self.add_message('E1304', node=node, args=key) - for key in keys: - if key not in required_keys: - self.add_message('W1301', node=node, args=key) - elif isinstance(args, OTHER_NODES + (astng.Tuple,)): - type_name = type(args).__name__ - self.add_message('E1303', node=node, args=type_name) - # else: - # The RHS of the format specifier is a name or - # expression. It may be a mapping object, so - # there's nothing we can check. - else: - # The format string uses only unnamed format specifiers. - # Check that the number of arguments passed to the RHS of - # the % operator matches the number required by the format - # string. - if isinstance(args, astng.Tuple): - num_args = len(args.elts) - elif isinstance(args, OTHER_NODES + (astng.Dict, astng.DictComp)): - num_args = 1 - else: - # The RHS of the format specifier is a name or - # expression. It could be a tuple of unknown size, so - # there's nothing we can check. - num_args = None - if num_args is not None: - if num_args > required_num_args: - self.add_message('E1305', node=node) - elif num_args < required_num_args: - self.add_message('E1306', node=node) - - -def register(linter): - """required method to auto register this checker """ - linter.register_checker(StringFormatChecker(linter)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/pylintplugins/strings.py new/SaltTesting-2015.7.10/salttesting/pylintplugins/strings.py --- old/SaltTesting-2015.2.16/salttesting/pylintplugins/strings.py 2014-09-10 23:29:06.000000000 +0200 +++ new/SaltTesting-2015.7.10/salttesting/pylintplugins/strings.py 2015-05-06 11:31:25.000000000 +0200 @@ -9,7 +9,10 @@ Proper string formatting PyLint checker ''' - +# ----- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------> +# This Pylint plugin is deprecated. Development continues on the SaltPyLint package +# <---- DEPRECATED PYLINT PLUGIN ------------------------------------------------------------------------------------- +from __future__ import absolute_import import re import sys try: @@ -27,6 +30,8 @@ except ImportError: # < pylint 1.0 from pylint.interfaces import IASTNGChecker as IAstroidChecker # pylint: disable=no-name-in-module +import six + MSGS = { 'W1320': ('String format call with un-indexed curly braces: %r', @@ -81,7 +86,7 @@ return if not (isinstance(node.left, astroid.Const) and - isinstance(node.left.value, basestring)): + isinstance(node.left.value, six.string_types)): return try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/runtests.py new/SaltTesting-2015.7.10/salttesting/runtests.py --- old/SaltTesting-2015.2.16/salttesting/runtests.py 2014-11-11 21:40:02.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/runtests.py 2015-07-01 19:23:34.000000000 +0200 @@ -304,7 +304,7 @@ ''' # Import Python modules -from __future__ import absolute_import +from __future__ import absolute_import, print_function import os import re import imp @@ -534,9 +534,9 @@ yield name, value def __getattribute__(self, name): - if name in object.__getattribute__(self, '__self_attributes__'): - return object.__getattribute__(self, name) - return object.__getattribute__(self, '_vars')[name] + if name in object.__getattribute__(self, '_vars'): + return object.__getattribute__(self, '_vars')[name] + return object.__getattribute__(self, name) def __setattr__(self, name, value): if getattr(self, '_locked', False) is True: @@ -1376,7 +1376,7 @@ 'where the salt code resides' ) - self.colors = get_colors(self.options.no_color is False) + self.colors = get_colors(self.options.no_colors is False) # (Major version, Minor version, Nr. commits) ignoring bugfix and rc's required_salt_version = (__saltstack_version__.major, __saltstack_version__.minor, __saltstack_version__.noc) @@ -1407,7 +1407,7 @@ # Parse ARGV again now that we have more of the required data... # Yes, it's not neat... self.options = super(SaltRuntests, self).parse_args(args, namespace) - self.colors = get_colors(self.options.no_color is False) + self.colors = get_colors(self.options.no_colors is False) # ----- Coverage Checks -------------------------------------------------------------------------------------> if (self.options.coverage_html_output or self.options.coverage_xml_output) and not self.options.coverage: @@ -1686,7 +1686,7 @@ ''' Print a nicely formatted report about the test suite results ''' - print + print() print_header( u' Overall Tests Report ', sep=u'=', centered=True, inline=True, width=self.options.output_columns diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/unit.py new/SaltTesting-2015.7.10/salttesting/unit.py --- old/SaltTesting-2015.2.16/salttesting/unit.py 2015-01-21 01:14:14.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/unit.py 2015-05-06 11:01:04.000000000 +0200 @@ -21,6 +21,7 @@ ''' # Import python libs +from __future__ import absolute_import import sys import logging try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/version.py new/SaltTesting-2015.7.10/salttesting/version.py --- old/SaltTesting-2015.2.16/salttesting/version.py 2015-02-12 18:29:40.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/version.py 2015-07-10 18:40:25.000000000 +0200 @@ -8,5 +8,8 @@ :license: Apache 2.0, see LICENSE for more details. ''' -__version_info__ = (2015, 2, 16) -__version__ = '.'.join(map(str, __version_info__)) +# Import Python Libs +from __future__ import absolute_import + +__version_info__ = (2015, 7, 10) +__version__ = '{0}.{1}.{2}'.format(*__version_info__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/salttesting/xmlunit.py new/SaltTesting-2015.7.10/salttesting/xmlunit.py --- old/SaltTesting-2015.2.16/salttesting/xmlunit.py 2014-12-13 00:58:06.000000000 +0100 +++ new/SaltTesting-2015.7.10/salttesting/xmlunit.py 2015-05-06 23:16:56.000000000 +0200 @@ -12,10 +12,14 @@ ''' # Import python libs +from __future__ import absolute_import import sys import locale import logging -from StringIO import StringIO + +# Import 3rd-party libs +import six +from six import StringIO log = logging.getLogger(__name__) @@ -51,7 +55,7 @@ return encodings def write(self, text): - if not isinstance(text, unicode): + if not isinstance(text, six.text_type): log.debug('Converting non unicode text into unicde') for enc in self._get_encodings(): try: @@ -59,7 +63,7 @@ break except UnicodeDecodeError: continue - if isinstance(text, unicode): + if isinstance(text, six.text_type): text = text.encode('utf-8') self._captured.write(text) self.delegate.write(text) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SaltTesting-2015.2.16/setup.py new/SaltTesting-2015.7.10/setup.py --- old/SaltTesting-2015.2.16/setup.py 2015-02-12 18:29:40.000000000 +0100 +++ new/SaltTesting-2015.7.10/setup.py 2015-05-06 13:58:42.000000000 +0200 @@ -33,7 +33,7 @@ SETUP_KWARGS['extras_require'] = { 'GitHub': ['requests>=2.4.2'] } - SETUP_KWARGS['install_requires'] = [] + SETUP_KWARGS['install_requires'] = ['six'] if sys.version_info < (2, 7): SETUP_KWARGS['install_requires'].extend(['unittest2', 'argparse'])