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

add options for arbitrary cherrypy config #67124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions changelog/67123.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Add options to inject arbitrary configuration into the CherryPy instance.

Two new keys have been added under the "cherry\_py" master config.

- "global" : corresponds to the "global" CherryPy config.
- "/" : corresponds to the "/" CherryPy config.
14 changes: 14 additions & 0 deletions salt/netapi/rest_cherrypy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@
A URL path to the main entry point for the application. This is useful
for serving multiple applications from the same URL.

global : ``{}``
A dictionary of additional CherryPy "global" configuration. See the
CherryPy documentation for more information.

.. versionadded:: 3008

/ : ``{}``
A dictionary of additional CherryPy "/" configuration. See the CherryPy
documentation for more information.

.. versionadded:: 3008
.. _rest_cherrypy-auth:

Authentication
Expand Down Expand Up @@ -2931,6 +2942,9 @@ def get_conf(self):
"tools.staticdir.dir": self.apiopts["static"],
}

conf["global"].update(self.apiopts.get("global", {}))
conf["/"].update(self.apiopts.get("/", {}))

# Add to global config
cherrypy.config.update(conf["global"])

Expand Down