opentf-toolkit-nightly 0.59.0.dev1200__py3-none-any.whl → 0.59.0.dev1204__py3-none-any.whl
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.
- opentf/commons/__init__.py +2 -0
- opentf/schemas/opentestfactory.org/v1/ExecutionResult.json +1 -17
- opentf/schemas/opentestfactory.org/v1alpha1/ExecutionResult.json +1 -17
- opentf/toolkit/channels.py +18 -13
- {opentf_toolkit_nightly-0.59.0.dev1200.dist-info → opentf_toolkit_nightly-0.59.0.dev1204.dist-info}/METADATA +1 -1
- {opentf_toolkit_nightly-0.59.0.dev1200.dist-info → opentf_toolkit_nightly-0.59.0.dev1204.dist-info}/RECORD +9 -9
- {opentf_toolkit_nightly-0.59.0.dev1200.dist-info → opentf_toolkit_nightly-0.59.0.dev1204.dist-info}/LICENSE +0 -0
- {opentf_toolkit_nightly-0.59.0.dev1200.dist-info → opentf_toolkit_nightly-0.59.0.dev1204.dist-info}/WHEEL +0 -0
- {opentf_toolkit_nightly-0.59.0.dev1200.dist-info → opentf_toolkit_nightly-0.59.0.dev1204.dist-info}/top_level.txt +0 -0
opentf/commons/__init__.py
CHANGED
|
@@ -68,6 +68,7 @@ REASON_STATUS = {
|
|
|
68
68
|
'Created': 201,
|
|
69
69
|
'Accepted': 202,
|
|
70
70
|
'NoContent': 204,
|
|
71
|
+
'PartialContent': 206,
|
|
71
72
|
'BadRequest': 400,
|
|
72
73
|
'Unauthorized': 401,
|
|
73
74
|
'PaymentRequired': 402,
|
|
@@ -75,6 +76,7 @@ REASON_STATUS = {
|
|
|
75
76
|
'NotFound': 404,
|
|
76
77
|
'AlreadyExists': 409,
|
|
77
78
|
'Conflict': 409,
|
|
79
|
+
'RangeNotSatisfiable': 416,
|
|
78
80
|
'Invalid': 422,
|
|
79
81
|
'TooManyRequests': 429, # https://datatracker.ietf.org/doc/html/rfc6585
|
|
80
82
|
'InternalError': 500,
|
|
@@ -101,23 +101,7 @@
|
|
|
101
101
|
"type": "object",
|
|
102
102
|
"patternProperties": {
|
|
103
103
|
"^[a-zA-Z0-9_]+$": {
|
|
104
|
-
"
|
|
105
|
-
{
|
|
106
|
-
"type": "string"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"type": "object",
|
|
110
|
-
"properties": {
|
|
111
|
-
"value": {
|
|
112
|
-
"type": "string"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"required": [
|
|
116
|
-
"value"
|
|
117
|
-
],
|
|
118
|
-
"additionalProperties": false
|
|
119
|
-
}
|
|
120
|
-
]
|
|
104
|
+
"type": "string"
|
|
121
105
|
}
|
|
122
106
|
},
|
|
123
107
|
"minProperties": 1
|
|
@@ -101,23 +101,7 @@
|
|
|
101
101
|
"type": "object",
|
|
102
102
|
"patternProperties": {
|
|
103
103
|
"^[a-zA-Z0-9_]+$": {
|
|
104
|
-
"
|
|
105
|
-
{
|
|
106
|
-
"type": "string"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"type": "object",
|
|
110
|
-
"properties": {
|
|
111
|
-
"value": {
|
|
112
|
-
"type": "string"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"required": [
|
|
116
|
-
"value"
|
|
117
|
-
],
|
|
118
|
-
"additionalProperties": false
|
|
119
|
-
}
|
|
120
|
-
]
|
|
104
|
+
"type": "string"
|
|
121
105
|
}
|
|
122
106
|
},
|
|
123
107
|
"minProperties": 1
|
opentf/toolkit/channels.py
CHANGED
|
@@ -127,8 +127,10 @@ REMOVE_WORKSPACE = 2
|
|
|
127
127
|
MOVE_TO_WORKSPACE = 3
|
|
128
128
|
|
|
129
129
|
HOOKS_ANNOTATIONS = 'opentestfactory.org/hooks'
|
|
130
|
+
|
|
130
131
|
OPENTF_VARIABLES_TYPE = 'application/vnd.opentestfactory.opentf-variables'
|
|
131
132
|
OPENTF_VARIABLES_REGEX = re.compile(r'^(export|set)\s(\"?.+)$')
|
|
133
|
+
OPENTF_VARIABLES_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_]+$')
|
|
132
134
|
|
|
133
135
|
## os helpers
|
|
134
136
|
|
|
@@ -221,26 +223,29 @@ def _as_log(line: str, jobstate: JobState):
|
|
|
221
223
|
return mask(line, jobstate).rstrip()
|
|
222
224
|
|
|
223
225
|
|
|
224
|
-
def _get_opentf_variables(path: str):
|
|
226
|
+
def _get_opentf_variables(path: str) -> Dict[str, str]:
|
|
225
227
|
variables = {}
|
|
226
228
|
with open(path, 'r') as f:
|
|
227
|
-
|
|
228
|
-
for line in content:
|
|
229
|
+
for line in f.readlines():
|
|
229
230
|
if '=' not in line:
|
|
230
231
|
continue
|
|
231
232
|
line = line.strip()
|
|
232
233
|
if set_export := OPENTF_VARIABLES_REGEX.match(line):
|
|
233
|
-
|
|
234
|
-
if
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
key
|
|
239
|
-
variables[key] = value
|
|
234
|
+
line = set_export.group(2)
|
|
235
|
+
if line.startswith('"'):
|
|
236
|
+
line = line[1:-1]
|
|
237
|
+
key, _, value = line.partition('=')
|
|
238
|
+
if OPENTF_VARIABLES_NAME_REGEX.match(key):
|
|
239
|
+
variables[key] = value
|
|
240
240
|
return variables
|
|
241
241
|
|
|
242
242
|
|
|
243
|
-
def process_opentf_variables(result: Dict[str, Any]):
|
|
243
|
+
def process_opentf_variables(result: Dict[str, Any]) -> None:
|
|
244
|
+
"""Process OPENTF_VARIABLES attachment if available.
|
|
245
|
+
|
|
246
|
+
If OPENTF_VARIABLES is in the attachments, move its content to
|
|
247
|
+
the variables field of the result.
|
|
248
|
+
"""
|
|
244
249
|
if attachments := result['metadata'].get('attachments'):
|
|
245
250
|
variables = {}
|
|
246
251
|
for path, data in attachments.copy().items():
|
|
@@ -311,8 +316,8 @@ def process_output(
|
|
|
311
316
|
- stderr: a list of strings
|
|
312
317
|
- jobstate: a JobState object
|
|
313
318
|
- context: a dictionary, channelhandler context
|
|
314
|
-
-
|
|
315
|
-
-
|
|
319
|
+
- _get: a function copying a remote file to a local path
|
|
320
|
+
- _put: a function copying a local file to a remote environment
|
|
316
321
|
|
|
317
322
|
# Returned value
|
|
318
323
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentf-toolkit-nightly
|
|
3
|
-
Version: 0.59.0.
|
|
3
|
+
Version: 0.59.0.dev1204
|
|
4
4
|
Summary: OpenTestFactory Orchestrator Toolkit
|
|
5
5
|
Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
|
|
6
6
|
Author: Martin Lafaix
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
opentf/commons/__init__.py,sha256=
|
|
1
|
+
opentf/commons/__init__.py,sha256=JLif958eOnOeJSQ6bLF-Dpr_aFJ3JtxHrjvUe_KbzEc,22579
|
|
2
2
|
opentf/commons/auth.py,sha256=bM2Z3kxm2Wku1lKXaRAIg37LHvXWAXIZIqjplDfN2P8,15899
|
|
3
3
|
opentf/commons/config.py,sha256=dyus4K5Zdmcftc3Y9Z1YRkzA1KwiRLHoeAlg2_A49QM,7876
|
|
4
4
|
opentf/commons/datasources.py,sha256=GSbjrYnZQup2B3r7T7l3C_o6R2jS13nQiu6dRitoenk,26194
|
|
@@ -9,7 +9,7 @@ opentf/commons/selectors.py,sha256=DEpLgRAr5HXSpSYI4liXP2hLUTvOSexFa9Vfa1xIQTk,7
|
|
|
9
9
|
opentf/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
opentf/schemas/abac.opentestfactory.org/v1alpha1/Policy.json,sha256=JXsfNAPSEYggeyaDutSQBeG38o4Bmcr70dPLWWeqIh8,2105
|
|
11
11
|
opentf/schemas/opentestfactory.org/v1/ExecutionCommand.json,sha256=UtmAlTaYdPSZDeQnx-ocX8IonyEPWoNmgDkHwQwQxWE,4126
|
|
12
|
-
opentf/schemas/opentestfactory.org/v1/ExecutionResult.json,sha256=
|
|
12
|
+
opentf/schemas/opentestfactory.org/v1/ExecutionResult.json,sha256=u0n-WYXNX9d0cEyu2D4tegU35k2Gf3eA6PGs9Uz4QDg,3275
|
|
13
13
|
opentf/schemas/opentestfactory.org/v1/GeneratorResult.json,sha256=sOwieyDWi6UZR7X29R9IjOR87ruSRQ4U6CM2_yT81Zk,16607
|
|
14
14
|
opentf/schemas/opentestfactory.org/v1/ProviderCommand.json,sha256=EU4kvEKxlqpH2IkLZ1HdBealuG6C0YzPkAtI7dNrfHg,4427
|
|
15
15
|
opentf/schemas/opentestfactory.org/v1/ProviderResult.json,sha256=Ej4zhCE3rCqCGKcaeAoIHwSJTV_7fw-rAxhJ52qA-Gs,9641
|
|
@@ -24,7 +24,7 @@ opentf/schemas/opentestfactory.org/v1alpha1/ChannelHandlerHooks.json,sha256=6K6m
|
|
|
24
24
|
opentf/schemas/opentestfactory.org/v1alpha1/EventBusConfig.json,sha256=2aIYtA07qRoauKNy-MH25Kzg1l1Q1fjY9_4YIvlyYgw,2174
|
|
25
25
|
opentf/schemas/opentestfactory.org/v1alpha1/ExecutionCommand.json,sha256=Tsqy0imNqO6Qg6B_Yw-4OeNer3xpURv-ZDaYUoZ-l1c,2702
|
|
26
26
|
opentf/schemas/opentestfactory.org/v1alpha1/ExecutionError.json,sha256=tz8ZggvjSkP2S9ln77Js03LkTnMCTuRVkC1Z3w8uI8k,1347
|
|
27
|
-
opentf/schemas/opentestfactory.org/v1alpha1/ExecutionResult.json,sha256=
|
|
27
|
+
opentf/schemas/opentestfactory.org/v1alpha1/ExecutionResult.json,sha256=UeWc4TfRY3G1CnMapFxXWRunaXzZdxOIle3DxURSf-A,3287
|
|
28
28
|
opentf/schemas/opentestfactory.org/v1alpha1/GeneratorCommand.json,sha256=uxbqDhP4newgz-85TnGKbchx448QEQ8WB5PXpcJy2ME,1754
|
|
29
29
|
opentf/schemas/opentestfactory.org/v1alpha1/GeneratorResult.json,sha256=LkHLGt2uam1Q5Ux0zP_O9oFgxBMCjD3Th3BsfsXxd1g,6633
|
|
30
30
|
opentf/schemas/opentestfactory.org/v1alpha1/InsightCollector.json,sha256=emE0My2cYBRnfA8L3_eY8yOXbSErV4TlwmQbRCgT4O8,16770
|
|
@@ -56,10 +56,10 @@ opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG
|
|
|
56
56
|
opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
|
|
57
57
|
opentf/scripts/startup.py,sha256=sggwEpMx7PTaSgYzs-2uCF5YZzpsncMyTlfF_G60CrE,21518
|
|
58
58
|
opentf/toolkit/__init__.py,sha256=mYeJPZ92ulbTBItqEsZgF4nnuRh6G19QPY3Jxc92ifc,23028
|
|
59
|
-
opentf/toolkit/channels.py,sha256=
|
|
59
|
+
opentf/toolkit/channels.py,sha256=2t33EAenmkCJj6Tc4QO-LZDz-nztvsj2I9usqDlNXco,21603
|
|
60
60
|
opentf/toolkit/core.py,sha256=cscUkwdwvLkerqMRL05dgtKJ42QbBQQc28kRBiyZM9o,9883
|
|
61
|
-
opentf_toolkit_nightly-0.59.0.
|
|
62
|
-
opentf_toolkit_nightly-0.59.0.
|
|
63
|
-
opentf_toolkit_nightly-0.59.0.
|
|
64
|
-
opentf_toolkit_nightly-0.59.0.
|
|
65
|
-
opentf_toolkit_nightly-0.59.0.
|
|
61
|
+
opentf_toolkit_nightly-0.59.0.dev1204.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
62
|
+
opentf_toolkit_nightly-0.59.0.dev1204.dist-info/METADATA,sha256=K-yDvUZOfq-_b5kb4uNqbLervQNJXcr_SKeYHUDsbXA,1940
|
|
63
|
+
opentf_toolkit_nightly-0.59.0.dev1204.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
64
|
+
opentf_toolkit_nightly-0.59.0.dev1204.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
|
|
65
|
+
opentf_toolkit_nightly-0.59.0.dev1204.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|