opentf-toolkit-nightly 0.63.0.dev1393__py3-none-any.whl → 0.63.0.dev1397__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.
@@ -210,26 +210,31 @@ def _add_default_variables(
210
210
  script.append(VARIABLE_MAKER[runner_os]('CI', 'true'))
211
211
 
212
212
 
213
- def _get_opentf_variables_path(metadata: Dict[str, Any]) -> str:
213
+ def get_opentf_variables_path(metadata: Dict[str, Any]) -> str:
214
214
  return VARIABLES_TEMPLATE[metadata['channel_os']].format(
215
215
  job_id=metadata['job_id'], root=metadata['channel_temp']
216
216
  )
217
217
 
218
218
 
219
- def _get_opentf_variables(path: str) -> Dict[str, str]:
219
+ def _read_opentf_variables(lines: List[str]) -> Dict[str, str]:
220
220
  variables = {}
221
+ for line in lines:
222
+ if '=' not in line:
223
+ continue
224
+ line = line.strip()
225
+ if set_export := OPENTF_VARIABLES_REGEX.match(line):
226
+ line = set_export.group(2)
227
+ if line.startswith('"'):
228
+ line = line[1:-1]
229
+ key, _, value = line.partition('=')
230
+ if OPENTF_VARIABLES_NAME_REGEX.match(key):
231
+ variables[key] = value
232
+ return variables
233
+
234
+
235
+ def _get_opentf_variables(path: str) -> Dict[str, str]:
221
236
  with open(path, 'r') as f:
222
- for line in f.readlines():
223
- if '=' not in line:
224
- continue
225
- line = line.strip()
226
- if set_export := OPENTF_VARIABLES_REGEX.match(line):
227
- line = set_export.group(2)
228
- if line.startswith('"'):
229
- line = line[1:-1]
230
- key, _, value = line.partition('=')
231
- if OPENTF_VARIABLES_NAME_REGEX.match(key):
232
- variables[key] = value
237
+ variables = _read_opentf_variables(f.readlines())
233
238
  try:
234
239
  os.remove(path)
235
240
  except FileNotFoundError:
@@ -428,6 +433,7 @@ def process_output(
428
433
  jobstate: JobState,
429
434
  _get: Callable[[str, str], None],
430
435
  _put: Callable[[str, str], None],
436
+ variables: Optional[List[str]] = None,
431
437
  ) -> Dict[str, Any]:
432
438
  """Process output, filling structures.
433
439
 
@@ -566,8 +572,14 @@ def process_output(
566
572
  if metadata.get('artifacts'):
567
573
  del metadata['artifacts']
568
574
 
575
+ opentf_variables = None
569
576
  if metadata['step_sequence_id'] != CHANNEL_RELEASE:
570
- _attach(_get_opentf_variables_path(metadata), f'type={OPENTF_VARIABLES_TYPE}')
577
+ if variables:
578
+ opentf_variables = _read_opentf_variables(variables)
579
+ else:
580
+ _attach(
581
+ get_opentf_variables_path(metadata), f'type={OPENTF_VARIABLES_TYPE}'
582
+ )
571
583
 
572
584
  result = make_event(EXECUTIONRESULT, metadata=metadata, status=resp)
573
585
  if outputs:
@@ -579,7 +591,8 @@ def process_output(
579
591
  result['metadata']['attachments'] = attachments_metadata
580
592
  if has_artifacts:
581
593
  result['metadata']['upload'] = resp
582
-
594
+ if opentf_variables:
595
+ result['variables'] = opentf_variables
583
596
  return result
584
597
 
585
598
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.63.0.dev1393
3
+ Version: 0.63.0.dev1397
4
4
  Summary: OpenTestFactory Orchestrator Toolkit
5
5
  Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
6
6
  Author: Martin Lafaix
@@ -58,11 +58,11 @@ opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG
58
58
  opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
59
59
  opentf/scripts/startup.py,sha256=K-uW-70EJb4Ou2dBFR_7utDU3oMWBczkomtikq_2qCc,23119
60
60
  opentf/toolkit/__init__.py,sha256=YnH66dmePAIU7dq_xWFYTIEUrsL9qV9f82LRDiBzbzs,22057
61
- opentf/toolkit/channels.py,sha256=oXZzW5bwcnGbJ7WAIkV42ekFnOQq7HxIvnyvURWaoNs,25904
61
+ opentf/toolkit/channels.py,sha256=7uHpQUCWCzSxcQifeUL9SB9fvsq6_9cZt_8IdBgw8FQ,26272
62
62
  opentf/toolkit/core.py,sha256=jMBDIYZ8Qn3BvsysfKoG0iTtjOnZsggetpH3eXygCsI,9636
63
63
  opentf/toolkit/models.py,sha256=PNfXVQbeyOwDfaNrLjcfhYm6duMSlNWBtZsWZcs53ag,6583
64
- opentf_toolkit_nightly-0.63.0.dev1393.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
- opentf_toolkit_nightly-0.63.0.dev1393.dist-info/METADATA,sha256=qLd_GytuE-XM02HMzjQN_vxrvV6jkVN8_EwHahEtUvc,2215
66
- opentf_toolkit_nightly-0.63.0.dev1393.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
67
- opentf_toolkit_nightly-0.63.0.dev1393.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
68
- opentf_toolkit_nightly-0.63.0.dev1393.dist-info/RECORD,,
64
+ opentf_toolkit_nightly-0.63.0.dev1397.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
+ opentf_toolkit_nightly-0.63.0.dev1397.dist-info/METADATA,sha256=vEYD3Fg0XWwNxtheNasZuvo8NDBsGF3ffn_o52w6Ffk,2215
66
+ opentf_toolkit_nightly-0.63.0.dev1397.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
67
+ opentf_toolkit_nightly-0.63.0.dev1397.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
68
+ opentf_toolkit_nightly-0.63.0.dev1397.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5