iris-pex-embedded-python 3.5.6b6__tar.gz → 3.5.6b8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. {iris_pex_embedded_python-3.5.6b6/src/iris_pex_embedded_python.egg-info → iris_pex_embedded_python-3.5.6b8}/PKG-INFO +1 -1
  2. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/pyproject.toml +1 -1
  3. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_remote.py +14 -10
  4. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Service/Remote/Rest/v1.cls +29 -12
  5. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8/src/iris_pex_embedded_python.egg-info}/PKG-INFO +1 -1
  6. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/LICENSE +0 -0
  7. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/README.md +0 -0
  8. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/setup.cfg +0 -0
  9. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/setup.py +0 -0
  10. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/__init__.py +0 -0
  11. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
  12. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
  13. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
  14. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
  15. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
  16. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
  17. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
  18. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
  19. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
  20. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
  21. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
  22. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
  23. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
  24. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
  25. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
  26. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
  27. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
  28. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
  29. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
  30. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
  31. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/__init__.py +0 -0
  32. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/__main__.py +0 -0
  33. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/_business_host.py +0 -0
  34. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/_cli.py +0 -0
  35. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/_common.py +0 -0
  36. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/_director.py +0 -0
  37. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/_utils.py +0 -0
  38. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/grongier/pex/wsgi/handlers.py +0 -0
  39. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/__init__.py +0 -0
  40. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/__main__.py +0 -0
  41. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_async_request.py +0 -0
  42. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_business_host.py +0 -0
  43. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_business_operation.py +0 -0
  44. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_business_process.py +0 -0
  45. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_business_service.py +0 -0
  46. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_cli.py +0 -0
  47. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_common.py +0 -0
  48. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_debugpy.py +0 -0
  49. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_decorators.py +0 -0
  50. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_director.py +0 -0
  51. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_dispatch.py +0 -0
  52. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_generator_request.py +0 -0
  53. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_inbound_adapter.py +0 -0
  54. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_iris.py +0 -0
  55. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_local.py +0 -0
  56. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_log_manager.py +0 -0
  57. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_message.py +0 -0
  58. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_message_validator.py +0 -0
  59. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_outbound_adapter.py +0 -0
  60. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_private_session_duplex.py +0 -0
  61. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_private_session_process.py +0 -0
  62. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_serialization.py +0 -0
  63. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/_utils.py +0 -0
  64. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
  65. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/BusinessProcess.cls +0 -0
  66. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/BusinessService.cls +0 -0
  67. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Common.cls +0 -0
  68. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Director.cls +0 -0
  69. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
  70. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
  71. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
  72. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Generator/Message/Ack.cls +0 -0
  73. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Generator/Message/Poll.cls +0 -0
  74. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Generator/Message/Start.cls +0 -0
  75. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Generator/Message/StartPickle.cls +0 -0
  76. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Generator/Message/Stop.cls +0 -0
  77. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
  78. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
  79. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Message.cls +0 -0
  80. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
  81. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/PickleMessage.cls +0 -0
  82. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/PrivateSession/Duplex.cls +0 -0
  83. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
  84. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
  85. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +0 -0
  86. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
  87. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Projection.cls +0 -0
  88. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Service/Remote/Handler.cls +0 -0
  89. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
  90. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Test.cls +0 -0
  91. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Utils.cls +0 -0
  92. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/cls/IOP/Wrapper.cls +0 -0
  93. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iop/wsgi/handlers.py +0 -0
  94. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +0 -0
  95. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
  96. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
  97. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iris_pex_embedded_python.egg-info/requires.txt +0 -0
  98. {iris_pex_embedded_python-3.5.6b6 → iris_pex_embedded_python-3.5.6b8}/src/iris_pex_embedded_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iris_pex_embedded_python
3
- Version: 3.5.6b6
3
+ Version: 3.5.6b8
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "iris_pex_embedded_python"
6
- version = "3.5.6b6"
6
+ version = "3.5.6b8"
7
7
  description = "Iris Interoperability based on Embedded Python"
8
8
  readme = "README.md"
9
9
  authors = [
@@ -16,7 +16,7 @@ import json
16
16
  import os
17
17
  import signal
18
18
  import time
19
- from typing import Any, Dict, List, Optional
19
+ from typing import Any, Dict, List, Optional, Union
20
20
 
21
21
  import requests
22
22
  import urllib3
@@ -50,19 +50,19 @@ class _RemoteDirector:
50
50
  return resp.json()
51
51
 
52
52
  def _post(self, path: str, body: Optional[dict] = None) -> Any:
53
- b = {"namespace": self._namespace, **(body or {})}
54
53
  resp = requests.post(
55
- f"{self._base}{path}", json=b, auth=self._auth,
56
- verify=self._verify, timeout=30,
54
+ f"{self._base}{path}", json=(body or {}),
55
+ params={"namespace": self._namespace},
56
+ auth=self._auth, verify=self._verify, timeout=30,
57
57
  )
58
58
  resp.raise_for_status()
59
59
  return resp.json()
60
60
 
61
61
  def _put(self, path: str, body: Optional[dict] = None) -> Any:
62
- b = {"namespace": self._namespace, **(body or {})}
63
62
  resp = requests.put(
64
- f"{self._base}{path}", json=b, auth=self._auth,
65
- verify=self._verify, timeout=30,
63
+ f"{self._base}{path}", json=(body or {}),
64
+ params={"namespace": self._namespace},
65
+ auth=self._auth, verify=self._verify, timeout=30,
66
66
  )
67
67
  resp.raise_for_status()
68
68
  return resp.json()
@@ -190,18 +190,22 @@ class _RemoteDirector:
190
190
  target: Optional[str],
191
191
  message=None, # ignored remotely — not serialisable over HTTP
192
192
  classname: Optional[str] = None,
193
- body: Optional[str] = None,
193
+ body: Optional[Union[str, dict]] = None,
194
194
  ) -> dict:
195
195
  """Returns a dict: {"classname": "...", "body": "...", "truncated": false}"""
196
196
  payload: dict = {"target": target or ""}
197
197
  if classname:
198
198
  payload["classname"] = classname
199
- if body:
199
+ if body is not None:
200
200
  payload["body"] = body
201
201
  try:
202
202
  return self._check_error(self._post("/test", payload))
203
203
  except requests.exceptions.HTTPError as exc:
204
- raise RuntimeError(str(exc)) from exc
204
+ try:
205
+ err_msg = exc.response.json().get("error", str(exc))
206
+ except Exception:
207
+ err_msg = str(exc)
208
+ raise RuntimeError(err_msg) from exc
205
209
 
206
210
  # ------------------------------------------------------------------
207
211
  # Export
@@ -44,6 +44,15 @@ ClassMethod GetNsParam() As %String [ Internal, Private ]
44
44
  Quit $select(ns="":"USER", 1:ns)
45
45
  }
46
46
 
47
+ /// Return the namespace, preferring a body field over the query parameter.
48
+ ClassMethod ResolveNs(dyna As %DynamicObject = "") As %String [ Internal, Private ]
49
+ {
50
+ Set ns = ""
51
+ If $isobject(dyna) { Set ns = dyna.%Get("namespace") }
52
+ If ns = "" { Set ns = ..GetNsParam() }
53
+ Quit ns
54
+ }
55
+
47
56
  ClassMethod GetStatus() As %Status
48
57
  {
49
58
  Try {
@@ -68,7 +77,7 @@ ClassMethod PostStart() As %Status
68
77
  {
69
78
  Try {
70
79
  Set dyna = {}.%FromJSON(%request.Content)
71
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
80
+ Set ns = ..ResolveNs(dyna)
72
81
  Set production = dyna.%Get("production")
73
82
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
74
83
  If production = "" { Set production = $Get(^Ens.Configuration("csp","LastProduction")) }
@@ -82,8 +91,8 @@ ClassMethod PostStart() As %Status
82
91
  ClassMethod PostStop() As %Status
83
92
  {
84
93
  Try {
85
- Set dyna = {}.%FromJSON(%request.Content)
86
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
94
+ Try { Set dyna = {}.%FromJSON(%request.Content) } Catch { Set dyna = {} }
95
+ Set ns = ..ResolveNs(dyna)
87
96
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
88
97
  $$$ThrowOnError(##class(Ens.Director).StopProduction())
89
98
  Return ..%WriteResponse({"status": "stopped"}.%ToJSON())
@@ -95,8 +104,8 @@ ClassMethod PostStop() As %Status
95
104
  ClassMethod PostKill() As %Status
96
105
  {
97
106
  Try {
98
- Set dyna = {}.%FromJSON(%request.Content)
99
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
107
+ Try { Set dyna = {}.%FromJSON(%request.Content) } Catch { Set dyna = {} }
108
+ Set ns = ..ResolveNs(dyna)
100
109
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
101
110
  $$$ThrowOnError(##class(Ens.Director).StopProduction(10, 1))
102
111
  Return ..%WriteResponse({"status": "killed"}.%ToJSON())
@@ -108,8 +117,8 @@ ClassMethod PostKill() As %Status
108
117
  ClassMethod PostRestart() As %Status
109
118
  {
110
119
  Try {
111
- Set dyna = {}.%FromJSON(%request.Content)
112
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
120
+ Try { Set dyna = {}.%FromJSON(%request.Content) } Catch { Set dyna = {} }
121
+ Set ns = ..ResolveNs(dyna)
113
122
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
114
123
  $$$ThrowOnError(##class(Ens.Director).RestartProduction())
115
124
  Return ..%WriteResponse({"status": "restarted"}.%ToJSON())
@@ -121,8 +130,8 @@ ClassMethod PostRestart() As %Status
121
130
  ClassMethod PostUpdate() As %Status
122
131
  {
123
132
  Try {
124
- Set dyna = {}.%FromJSON(%request.Content)
125
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
133
+ Try { Set dyna = {}.%FromJSON(%request.Content) } Catch { Set dyna = {} }
134
+ Set ns = ..ResolveNs(dyna)
126
135
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
127
136
  $$$ThrowOnError(##class(Ens.Director).UpdateProduction())
128
137
  Return ..%WriteResponse({"status": "updated"}.%ToJSON())
@@ -169,7 +178,7 @@ ClassMethod PutDefault() As %Status
169
178
  {
170
179
  Try {
171
180
  Set dyna = {}.%FromJSON(%request.Content)
172
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
181
+ Set ns = ..ResolveNs(dyna)
173
182
  Set production = dyna.%Get("production")
174
183
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
175
184
  Set ^Ens.Configuration("csp","LastProduction") = production
@@ -246,13 +255,19 @@ ClassMethod GetExport() As %Status
246
255
  ClassMethod PostTest() As %Status
247
256
  {
248
257
  Try {
258
+ // Capture output to avoid writing directly to the response stream, which would break the JSON format. We'll include captured output in the response.
259
+ set sc = $$BeginCapture^%SYS.Capture(.msg)
260
+
249
261
  Set dyna = {}.%FromJSON(%request.Content)
250
262
  Set target = dyna.%Get("target")
251
263
  Set classname = dyna.%Get("classname")
252
264
  Set body = dyna.%Get("body")
253
- Set ns = dyna.%Get("namespace") If ns = "" { Set ns = "USER" }
265
+ Set ns = ..ResolveNs(dyna)
254
266
  If ns '= "" { Do ..NamespaceCheck(ns) New $NAMESPACE Set $NAMESPACE = ns }
255
267
 
268
+ // Normalize body: if it arrived as a JSON object, serialize it to a string
269
+ If $isobject(body) { Set body = body.%ToJSON() }
270
+
256
271
  // Build the request message
257
272
  If classname '= "" {
258
273
  Set message = ##class(IOP.Message).%New()
@@ -277,8 +292,10 @@ ClassMethod PostTest() As %Status
277
292
  Set result.classname = ""
278
293
  Set result.body = ""
279
294
  }
295
+ set sc = $$EndCapture^%SYS.Capture(msg,.msgArray)
280
296
  Return ..%WriteResponse(result.%ToJSON())
281
297
  } Catch ex {
298
+ set sc = $$EndCapture^%SYS.Capture(msg,.msgArray)
282
299
  Return ..%WriteErrorResponse(ex.DisplayString())
283
300
  }
284
301
  }
@@ -309,7 +326,7 @@ ClassMethod PutMigrate() As %DynamicObject
309
326
  // Get the request body
310
327
  set dyna = {}.%FromJSON(%request.Content)
311
328
  set body = dyna.%Get("body")
312
- set namespace = dyna.%Get("namespace")
329
+ set namespace = ..ResolveNs(dyna)
313
330
  set targetDirectory = dyna.%Get("remote_folder")
314
331
  set packageName = dyna.%Get("package")
315
332
  // check for namespace existence and user permissions against namespace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iris_pex_embedded_python
3
- Version: 3.5.6b6
3
+ Version: 3.5.6b8
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License