Skip to content

Commit

Permalink
Surprise, another parameter conflict in the OBS API (#105)
Browse files Browse the repository at this point in the history
The `deleted` parameter interferes with other `view` parameter values, too.

This is another fallout of openSUSE/open-build-service#9715
  • Loading branch information
crazyscientist authored Oct 11, 2022
1 parent 48ccca1 commit 4577963
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osctiny/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

__all__ = ['Osc', 'bs_requests', 'buildresults', 'comments', 'packages',
'projects', 'search', 'users']
__version__ = "0.7.5"
__version__ = "0.7.6"
8 changes: 6 additions & 2 deletions osctiny/extensions/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ def cleanup_params(**params) -> dict:
.. versionadded::0.7.4
"""
if params.get("view", None) == "info":
view = params.get("view", "")
if view == "info":
# The 'info' view is strict about parameter validation
return {key: value for key, value in params.items()
if key in ["parse", "arch", "repository", "view"]}

if "productlist" in view:
# The "deleted" parameter seems to have precedence over other acceptable parameters
# (e.g. "view")
return {key: value for key, value in params.items() if key not in ["deleted"]}
return params

def get_list(self, project: str, deleted: bool = False, expand: bool = True, **params):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _filter(requires):

setup(
name='osc-tiny',
version='0.7.5',
version='0.7.6',
description='Client API for openSUSE BuildService',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 4577963

Please sign in to comment.