Skip to content

Commit

Permalink
Merge branch 'develop' into parameter-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog authored Jul 12, 2024
2 parents b9a93e1 + 0a76c85 commit ba626b3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Brewtils Changelog
TBD

- Fixed bug where parameter type mapping did not match type hinting
- Exposed a read only feature to provide the current request that is being processed `from brewtils import get_current_request_read_only`
- Expand Job Export to include Job id

3.26.3
------
Expand Down
7 changes: 6 additions & 1 deletion brewtils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
from brewtils.config import get_argument_parser, get_connection_info, load_config
from brewtils.decorators import client, command, parameter, subscribe, system
from brewtils.log import configure_logging
from brewtils.plugin import Plugin, RemotePlugin # noqa F401
from brewtils.plugin import (
get_current_request_read_only,
Plugin,
RemotePlugin,
) # noqa F401
from brewtils.rest import normalize_url_prefix
from brewtils.rest.easy_client import EasyClient, get_easy_client
from brewtils.rest.publish_client import PublishClient
Expand All @@ -28,6 +32,7 @@
"configure_logging",
"normalize_url_prefix",
"AutoDecorator",
"get_current_request_read_only",
]

# Aliased for compatibility
Expand Down
10 changes: 10 additions & 0 deletions brewtils/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import copy
import json
import logging
import logging.config
Expand Down Expand Up @@ -46,6 +47,15 @@
CONFIG = Box(default_box=True)


def get_current_request_read_only():
"""Read-Only instance of Current Request
Returns a copy of the current request, modifications to this object
do not impact the actual current request
"""
return copy.deepcopy(request_context.current_request)


class Plugin(object):
"""A Beer-garden Plugin
Expand Down
1 change: 0 additions & 1 deletion brewtils/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ def __init__(self, *args, **kwargs):
# exclude fields from a Job that we don't want when we later go to import
# the Job definition
self.opts.exclude += (
"id",
"next_run_time",
"success_count",
"error_count",
Expand Down
1 change: 0 additions & 1 deletion brewtils/test/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ def job_dict_for_import(job_dict):
"""A job dict but some keys and values are missing."""
dict_copy = copy.deepcopy(job_dict)
for field in [
"id",
"next_run_time",
"success_count",
"error_count",
Expand Down

0 comments on commit ba626b3

Please sign in to comment.