Skip to content

Commit 3b4d97a

Browse files
committed
add options for arbitrary cherrypy config
1 parent 9233e1c commit 3b4d97a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

changelog/67123.added.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Add options to inject arbitrary configuration into the CherryPy instance.
2+
3+
Two new keys have been added under the "cherry\_py" master config.
4+
5+
- "global" : corresponds to the "global" CherryPy config.
6+
- "/" : corresponds to the "/" CherryPy config.

salt/netapi/rest_cherrypy/app.py

+14
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@
160160
A URL path to the main entry point for the application. This is useful
161161
for serving multiple applications from the same URL.
162162
163+
global : ``{}``
164+
A dictionary of additional CherryPy "global" configuration. See the
165+
CherryPy documentation for more information.
166+
167+
.. versionadded:: 3008
168+
169+
/ : ``{}``
170+
A dictionary of additional CherryPy "/" configuration. See the CherryPy
171+
documentation for more information.
172+
173+
.. versionadded:: 3008
163174
.. _rest_cherrypy-auth:
164175
165176
Authentication
@@ -2931,6 +2942,9 @@ def get_conf(self):
29312942
"tools.staticdir.dir": self.apiopts["static"],
29322943
}
29332944

2945+
conf["global"].update(self.apiopts.get("global", {}))
2946+
conf["/"].update(self.apiopts.get("/", {}))
2947+
29342948
# Add to global config
29352949
cherrypy.config.update(conf["global"])
29362950

0 commit comments

Comments
 (0)