From ab29cc8cc1a9a1bd1c235f7224bed37d1feb05aa Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Sun, 15 Sep 2013 16:58:03 -0500 Subject: [PATCH 1/2] Fix regression in apt module This fixes a regression introduced in bd72e44. Resolves #7257. --- salt/modules/apt.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/salt/modules/apt.py b/salt/modules/apt.py index cd5e6c706a..689f9d72f1 100644 --- a/salt/modules/apt.py +++ b/salt/modules/apt.py @@ -137,9 +137,6 @@ def latest_version(*names, **kwargs): kwargs.pop('fromrepo', None) kwargs.pop('repo', None) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) - if len(names) == 0: return '' ret = {} From e29af84092d4ff7389244f18ac3ac03a8a4ce3f4 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Sun, 15 Sep 2013 18:58:53 -0500 Subject: [PATCH 2/2] Remove other kwargs checks that would cause tracebacks We need to do better arg checking, but this is not the way to go about it. --- salt/modules/brew.py | 2 -- salt/modules/ebuild.py | 2 -- salt/modules/freebsdpkg.py | 2 -- salt/modules/openbsdpkg.py | 2 -- salt/modules/pacman.py | 2 -- salt/modules/pkgin.py | 2 -- salt/modules/pkgng.py | 2 -- salt/modules/pkgutil.py | 2 -- salt/modules/solarispkg.py | 2 -- salt/modules/zypper.py | 2 -- 10 files changed, 20 deletions(-) diff --git a/salt/modules/brew.py b/salt/modules/brew.py index 25b5cbf85c..437a5f86d2 100644 --- a/salt/modules/brew.py +++ b/salt/modules/brew.py @@ -121,8 +121,6 @@ def latest_version(*names, **kwargs): salt '*' pkg.latest_version ''' kwargs.pop('refresh', True) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) if len(names) <= 1: return '' diff --git a/salt/modules/ebuild.py b/salt/modules/ebuild.py index 008b77a616..2eb5042b92 100644 --- a/salt/modules/ebuild.py +++ b/salt/modules/ebuild.py @@ -171,8 +171,6 @@ def latest_version(*names, **kwargs): salt '*' pkg.latest_version ... ''' refresh = salt.utils.is_true(kwargs.pop('refresh', True)) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) if len(names) == 0: return '' diff --git a/salt/modules/freebsdpkg.py b/salt/modules/freebsdpkg.py index e48c06f8ff..ef296a90f8 100644 --- a/salt/modules/freebsdpkg.py +++ b/salt/modules/freebsdpkg.py @@ -69,8 +69,6 @@ def latest_version(*names, **kwargs): ''' refresh = salt.utils.is_true(kwargs.pop('refresh', True)) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) ret = {} diff --git a/salt/modules/openbsdpkg.py b/salt/modules/openbsdpkg.py index 65c55e6446..59692700c6 100644 --- a/salt/modules/openbsdpkg.py +++ b/salt/modules/openbsdpkg.py @@ -81,8 +81,6 @@ def latest_version(*names, **kwargs): salt '*' pkg.latest_version ''' kwargs.pop('refresh', True) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) pkgs = list_pkgs() ret = {} diff --git a/salt/modules/pacman.py b/salt/modules/pacman.py index 2c2bd19961..bdfddae2dc 100644 --- a/salt/modules/pacman.py +++ b/salt/modules/pacman.py @@ -45,8 +45,6 @@ def latest_version(*names, **kwargs): salt '*' pkg.latest_version ... ''' refresh = salt.utils.is_true(kwargs.pop('refresh', True)) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) if len(names) == 0: return '' diff --git a/salt/modules/pkgin.py b/salt/modules/pkgin.py index a1c9b1bf54..dc5fbe2887 100644 --- a/salt/modules/pkgin.py +++ b/salt/modules/pkgin.py @@ -113,8 +113,6 @@ def latest_version(*names, **kwargs): ''' refresh = salt.utils.is_true(kwargs.pop('refresh', True)) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) pkglist = {} pkgin = _check_pkgin() diff --git a/salt/modules/pkgng.py b/salt/modules/pkgng.py index fbb3db5c3d..ad107499c9 100644 --- a/salt/modules/pkgng.py +++ b/salt/modules/pkgng.py @@ -73,8 +73,6 @@ def latest_version(pkg_name, **kwargs): ''' kwargs.pop('refresh', True) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) cmd = 'pkg info {0}'.format(pkg_name) out = __salt__['cmd.run'](cmd).split() diff --git a/salt/modules/pkgutil.py b/salt/modules/pkgutil.py index 852751971f..f9d773a8e9 100644 --- a/salt/modules/pkgutil.py +++ b/salt/modules/pkgutil.py @@ -186,8 +186,6 @@ def latest_version(*names, **kwargs): salt '*' pkgutil.latest_version ... ''' refresh = salt.utils.is_true(kwargs.pop('refresh', True)) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) if not names: return '' diff --git a/salt/modules/solarispkg.py b/salt/modules/solarispkg.py index aec0aa0406..c3b42c065f 100644 --- a/salt/modules/solarispkg.py +++ b/salt/modules/solarispkg.py @@ -128,8 +128,6 @@ def latest_version(*names, **kwargs): package. ''' kwargs.pop('refresh', True) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) ret = {} if not names: diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index 8a355c2d7f..c89781c549 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -70,8 +70,6 @@ def latest_version(*names, **kwargs): salt '*' pkg.latest_version ... ''' refresh = salt.utils.is_true(kwargs.pop('refresh', True)) - if kwargs: - raise TypeError('Got unexpected keyword argument(s): {0!r}'.format(kwargs)) if len(names) == 0: return ''