generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Expected Behaviour
When trying to print a job template to YAML after calling model_to_object and then using yaml.dump the template is properly formatted and a valid template.
Current Behaviour
When trying to print a job template to YAML after calling model_to_object and then using yaml.dump the template contains what look like objects instead of the strings that those objects are supposed to contain.
Reproduction Steps
Ran the code snippet linked below.
Code Snippet
parameters: JobParameterDefinitionList = []
parameters.append(
JobPathParameterDefinition(
name="Parameter1",
default="C:\\Users\\testing\\Desktop",
type=JobParameterType.PATH,
)
)
template = JobTemplate(
name="bug template",
specificationVersion="jobtemplate-2023-09",
parameterDefinitions=parameters,
steps=[
StepTemplate(
name="Main Step",
script=StepScript(
actions=StepActions(onRun=Action(command="echo", args=["hello"]))
),
)
],
)
template_obj = model_to_object(model=template)
print(yaml.dump(template_obj))
Results in:
name: !!python/object/new:openjd.model.v2023_09._model.JobTemplateName
args:
- bug template
state:
_processed_list:
- bug template
parameterDefinitions:
- default: C:\Users\testing\Desktop
name: Parameter1
type: !!python/object/apply:openjd.model.v2023_09._model.JobParameterType
- PATH
specificationVersion: !!python/object/apply:openjd.model._types.TemplateSpecificationVersion
- jobtemplate-2023-09
steps:
- name: Main Step
script:
actions:
onRun:
args:
- !!python/object/new:openjd.model.v2023_09._model.ArgString
args:
- hello
state:
_processed_list:
- hello
command: !!python/object/new:openjd.model.v2023_09._model.CommandString
args:
- echo
state:
_processed_list:
- echo
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers