Skip to content

Commit

Permalink
Implement workflow operations
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Jul 30, 2024
1 parent 9259851 commit 086ca02
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions osidb_bindings/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,34 @@ def file_trackers(self, form_data: Dict[str, Any], *args, **kwargs):
)


def promote_flaw(self, id, *args, **kwargs):
method_module = importlib.import_module(
f".bindings.python_client.api.osidb.osidb_api_{OSIDB_API_VERSION}_flaws_promote_create",
package="osidb_bindings",
)
sync_fn = get_sync_function(method_module)
return sync_fn(
id,
*args,
client=self.client(),
**kwargs,
)


def reject_flaw(self, id, *args, **kwargs):
method_module = importlib.import_module(
f".bindings.python_client.api.osidb.osidb_api_{OSIDB_API_VERSION}_flaws_reject_create",
package="osidb_bindings",
)
sync_fn = get_sync_function(method_module)
return sync_fn(
id,
*args,
client=self.client(),
**kwargs,
)


def double_underscores_to_single_underscores(fn):
"""
Function decorator which changes all the keyword arguments which include
Expand Down Expand Up @@ -214,6 +242,7 @@ def __init__(self, base_url, auth=None, verify_ssl=True):
]
},
},
extra_operations=[("promote", promote_flaw), ("reject", reject_flaw)],
)
self.affects = SessionOperationsGroup(
self.__get_client_with_new_access_token,
Expand Down

0 comments on commit 086ca02

Please sign in to comment.