Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partially unify public functions signature for pkg and lowpkg #51973

Merged
merged 2 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion salt/modules/aixpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def latest_version(*names, **kwargs):
available_version = salt.utils.functools.alias_function(latest_version, 'available_version')


def upgrade_available(name):
def upgrade_available(name, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand Down
12 changes: 6 additions & 6 deletions salt/modules/apkpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def version(*names, **kwargs):
return __salt__['pkg_resource.version'](*names, **kwargs)


def refresh_db():
def refresh_db(**kwargs):
'''
Updates the package list

Expand Down Expand Up @@ -425,7 +425,7 @@ def remove(name=None, pkgs=None, purge=False, **kwargs): # pylint: disable=unus
return ret


def upgrade(name=None, pkgs=None, refresh=True):
def upgrade(name=None, pkgs=None, refresh=True, **kwargs):
'''
Upgrades all packages via ``apk upgrade`` or a specific package if name or
pkgs is specified. Name is ignored if pkgs is specified
Expand Down Expand Up @@ -485,7 +485,7 @@ def upgrade(name=None, pkgs=None, refresh=True):
return ret


def list_upgrades(refresh=True):
def list_upgrades(refresh=True, **kwargs):
'''
List all available package upgrades.

Expand Down Expand Up @@ -524,7 +524,7 @@ def list_upgrades(refresh=True):
return ret


def file_list(*packages):
def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
Expand All @@ -541,7 +541,7 @@ def file_list(*packages):
return file_dict(*packages)


def file_dict(*packages):
def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
Expand Down Expand Up @@ -580,7 +580,7 @@ def file_dict(*packages):
return {'errors': errors, 'packages': ret}


def owner(*paths):
def owner(*paths, **kwargs):
'''
Return the name of the package that owns the file. Multiple file paths can
be passed. Like :mod:`pkg.version <salt.modules.apk.version`, if a single
Expand Down
14 changes: 7 additions & 7 deletions salt/modules/aptpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def version(*names, **kwargs):
return __salt__['pkg_resource.version'](*names, **kwargs)


def refresh_db(cache_valid_time=0, failhard=False):
def refresh_db(cache_valid_time=0, failhard=False, **kwargs):
'''
Updates the APT database to latest packages based upon repositories

Expand Down Expand Up @@ -1392,7 +1392,7 @@ def list_upgrades(refresh=True, dist_upgrade=True, **kwargs):
return _get_upgradable(dist_upgrade, **kwargs)


def upgrade_available(name):
def upgrade_available(name, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand All @@ -1405,7 +1405,7 @@ def upgrade_available(name):
return latest_version(name) != ''


def version_cmp(pkg1, pkg2, ignore_epoch=False):
def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
Expand Down Expand Up @@ -1595,7 +1595,7 @@ def _skip_source(source):
return False


def list_repos():
def list_repos(**kwargs):
'''
Lists all repos in the sources.list (and sources.lists.d) files

Expand Down Expand Up @@ -2362,7 +2362,7 @@ def mod_repo(repo, saltenv='base', **kwargs):
}


def file_list(*packages):
def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
Expand All @@ -2379,7 +2379,7 @@ def file_list(*packages):
return __salt__['lowpkg.file_list'](*packages)


def file_dict(*packages):
def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
Expand Down Expand Up @@ -2663,7 +2663,7 @@ def _resolve_deps(name, pkgs, **kwargs):
return


def owner(*paths):
def owner(*paths, **kwargs):
'''
.. versionadded:: 2014.7.0

Expand Down
6 changes: 3 additions & 3 deletions salt/modules/dpkg_lowpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def unpurge(*packages):
return salt.utils.data.compare_dicts(old, new)


def list_pkgs(*packages):
def list_pkgs(*packages, **kwargs):
'''
List the packages currently installed in a dict::

Expand Down Expand Up @@ -169,7 +169,7 @@ def list_pkgs(*packages):
return pkgs


def file_list(*packages):
def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
Expand Down Expand Up @@ -211,7 +211,7 @@ def file_list(*packages):
return {'errors': errors, 'files': list(ret)}


def file_dict(*packages):
def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
Expand Down
8 changes: 4 additions & 4 deletions salt/modules/ebuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def list_upgrades(refresh=True, backtrack=3, **kwargs): # pylint: disable=W0613
return _get_upgradable(backtrack)


def upgrade_available(name):
def upgrade_available(name, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand Down Expand Up @@ -442,7 +442,7 @@ def list_pkgs(versions_as_list=False, **kwargs):
return ret


def refresh_db():
def refresh_db(**kwargs):
'''
Update the portage tree using the first available method from the following
list:
Expand Down Expand Up @@ -767,7 +767,7 @@ def install(name=None,
return changes


def update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None):
def update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
Expand Down Expand Up @@ -860,7 +860,7 @@ def update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None):
return ret


def upgrade(refresh=True, binhost=None, backtrack=3):
def upgrade(refresh=True, binhost=None, backtrack=3, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
Expand Down
6 changes: 3 additions & 3 deletions salt/modules/freebsdpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def version(*names, **kwargs):
])


def refresh_db():
def refresh_db(**kwargs):
'''
``pkg_add(1)`` does not use a local database of available packages, so this
function simply returns ``True``. it exists merely for API compatibility.
Expand Down Expand Up @@ -503,7 +503,7 @@ def _rehash():
__salt__['cmd.shell']('rehash', output_loglevel='trace')


def file_list(*packages):
def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
Expand All @@ -525,7 +525,7 @@ def file_list(*packages):
return ret


def file_dict(*packages):
def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the
Expand Down
8 changes: 4 additions & 4 deletions salt/modules/mac_brew_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def remove(name=None, pkgs=None, **kwargs):
return ret


def refresh_db():
def refresh_db(**kwargs):
'''
Update the homebrew package repository.

Expand Down Expand Up @@ -459,7 +459,7 @@ def list_upgrades(refresh=True, **kwargs): # pylint: disable=W0613
return ret


def upgrade_available(pkg):
def upgrade_available(pkg, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand All @@ -472,7 +472,7 @@ def upgrade_available(pkg):
return pkg in list_upgrades()


def upgrade(refresh=True):
def upgrade(refresh=True, **kwargs):
'''
Upgrade outdated, unpinned brews.

Expand Down Expand Up @@ -517,7 +517,7 @@ def upgrade(refresh=True):
return ret


def info_installed(*names):
def info_installed(*names, **kwargs):
'''
Return the information of the named package(s) installed on the system.

Expand Down
6 changes: 3 additions & 3 deletions salt/modules/mac_portspkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def list_upgrades(refresh=True, **kwargs): # pylint: disable=W0613
return _list('outdated')


def upgrade_available(pkg, refresh=True):
def upgrade_available(pkg, refresh=True, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand All @@ -389,7 +389,7 @@ def upgrade_available(pkg, refresh=True):
return pkg in list_upgrades(refresh=refresh)


def refresh_db():
def refresh_db(**kwargs):
'''
Update ports with ``port selfupdate``

Expand All @@ -405,7 +405,7 @@ def refresh_db():
return salt.utils.mac_utils.execute_return_success(cmd)


def upgrade(refresh=True): # pylint: disable=W0613
def upgrade(refresh=True, **kwargs): # pylint: disable=W0613
'''
Run a full upgrade using MacPorts 'port upgrade outdated'

Expand Down
2 changes: 1 addition & 1 deletion salt/modules/openbsdpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def purge(name=None, pkgs=None, **kwargs):
return remove(name=name, pkgs=pkgs, purge=True)


def upgrade_available(name):
def upgrade_available(name, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand Down
10 changes: 5 additions & 5 deletions salt/modules/pacmanpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def latest_version(*names, **kwargs):
available_version = salt.utils.functools.alias_function(latest_version, 'available_version')


def upgrade_available(name):
def upgrade_available(name, **kwargs):
'''
Check whether or not an upgrade is available for a given package

Expand Down Expand Up @@ -393,7 +393,7 @@ def group_diff(name):
return ret


def refresh_db(root=None):
def refresh_db(root=None, **kwargs):
'''
Just run a ``pacman -Sy``, return a dict::

Expand Down Expand Up @@ -843,7 +843,7 @@ def purge(name=None, pkgs=None, **kwargs):
return _uninstall(action='purge', name=name, pkgs=pkgs)


def file_list(*packages):
def file_list(*packages, **kwargs):
'''
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
Expand Down Expand Up @@ -877,7 +877,7 @@ def file_list(*packages):
return {'errors': errors, 'files': ret}


def file_dict(*packages):
def file_dict(*packages, **kwargs):
'''
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
Expand Down Expand Up @@ -913,7 +913,7 @@ def file_dict(*packages):
return {'errors': errors, 'packages': ret}


def owner(*paths):
def owner(*paths, **kwargs):
'''
.. versionadded:: 2014.7.0

Expand Down
8 changes: 4 additions & 4 deletions salt/modules/pkgin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _splitpkg(name):
return name.split(';', 1)[0].rsplit('-', 1)


def search(pkg_name):
def search(pkg_name, **kwargs):
'''
Searches for an exact match using pkgin ^package$

Expand Down Expand Up @@ -230,7 +230,7 @@ def version(*names, **kwargs):
return __salt__['pkg_resource.version'](*names, **kwargs)


def refresh_db(force=False):
def refresh_db(force=False, **kwargs):
'''
Use pkg update to get latest pkg_summary

Expand Down Expand Up @@ -642,7 +642,7 @@ def _rehash():
__salt__['cmd.run']('rehash', output_loglevel='trace')


def file_list(package):
def file_list(package, **kwargs):
'''
List the files that belong to a package.

Expand All @@ -660,7 +660,7 @@ def file_list(package):
return ret


def file_dict(*packages):
def file_dict(*packages, **kwargs):
'''
.. versionchanged: 2016.3.0

Expand Down
4 changes: 2 additions & 2 deletions salt/modules/pkgng.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def version(*names, **kwargs):
info = salt.utils.functools.alias_function(version, 'info')


def refresh_db(jail=None, chroot=None, root=None, force=False):
def refresh_db(jail=None, chroot=None, root=None, force=False, **kwargs):
'''
Refresh PACKAGESITE contents

Expand Down Expand Up @@ -2441,7 +2441,7 @@ def _parse_upgrade(stdout):
return result


def version_cmp(pkg1, pkg2, ignore_epoch=False):
def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
'''
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
Expand Down
Loading