@@ -416,15 +416,15 @@ def get_terminating_behavior(component_config):
416416 return "ProcessIsNotSelfTerminating"
417417
418418 lm_config = {}
419- lm_config ["versionMajor " ] = 7
420- lm_config ["versionMinor " ] = 0
421- lm_config ["Process " ] = []
422- lm_config ["ModeGroup " ] = [
419+ lm_config ["version_major " ] = 7
420+ lm_config ["version_minor " ] = 0
421+ lm_config ["process " ] = []
422+ lm_config ["mode_group " ] = [
423423 {
424424 "identifier" : "MainPG" ,
425- "initialMode_name " : "not-used" ,
426- "recoveryMode_name " : get_recovery_process_group_state (config ),
427- "modeDeclaration " : [],
425+ "initial_mode_name " : "not-used" ,
426+ "recovery_mode_name " : get_recovery_process_group_state (config ),
427+ "mode_declaration " : [],
428428 }
429429 ]
430430
@@ -433,15 +433,17 @@ def get_terminating_behavior(component_config):
433433 # For each component, store which run targets depends on it
434434 for pgstate , values in config ["run_targets" ].items ():
435435 state_name = "MainPG/" + pgstate
436- lm_config ["ModeGroup" ][0 ]["modeDeclaration" ].append ({"identifier" : state_name })
436+ lm_config ["mode_group" ][0 ]["mode_declaration" ].append (
437+ {"identifier" : state_name }
438+ )
437439 components = get_process_dependencies (values )
438440 for component in components :
439441 if component not in process_group_states :
440442 process_group_states [component ] = []
441443 process_group_states [component ].append (state_name )
442444
443445 if fallback := config .get ("fallback_run_target" , {}):
444- lm_config ["ModeGroup " ][0 ]["modeDeclaration " ].append (
446+ lm_config ["mode_group " ][0 ]["mode_declaration " ].append (
445447 {"identifier" : "MainPG/fallback_run_target" }
446448 )
447449 fallback_components = get_process_dependencies (fallback )
@@ -464,57 +466,57 @@ def get_terminating_behavior(component_config):
464466 "supplementary_group_ids"
465467 ]
466468 ]
467- process ["securityPolicyDetails " ] = component_config ["deployment_config" ][
469+ process ["security_policy_details " ] = component_config ["deployment_config" ][
468470 "sandbox"
469471 ]["security_policy" ]
470- process ["numberOfRestartAttempts " ] = component_config ["deployment_config" ][
472+ process ["number_of_restart_attempts " ] = component_config ["deployment_config" ][
471473 "ready_recovery_action"
472474 ]["restart" ]["number_of_attempts" ]
473475
474476 match component_config ["component_properties" ]["application_profile" ][
475477 "application_type"
476478 ]:
477479 case "Native" :
478- process ["executable_reportingBehavior " ] = "DoesNotReportExecutionState"
480+ process ["executable_reporting_behavior " ] = "DoesNotReportExecutionState"
479481 case "State_Manager" :
480- process ["executable_reportingBehavior " ] = "ReportsExecutionState"
481- process ["functionClusterAffiliation " ] = "STATE_MANAGEMENT"
482+ process ["executable_reporting_behavior " ] = "ReportsExecutionState"
483+ process ["function_cluster_affiliation " ] = "STATE_MANAGEMENT"
482484 case "Reporting" | "Reporting_And_Supervised" :
483- process ["executable_reportingBehavior " ] = "ReportsExecutionState"
485+ process ["executable_reporting_behavior " ] = "ReportsExecutionState"
484486
485- process ["startupConfig " ] = [{}]
486- process ["startupConfig " ][0 ]["executionError " ] = "1"
487- process ["startupConfig " ][0 ]["identifier" ] = f"{ component_name } _startup_config"
488- process ["startupConfig " ][0 ]["enterTimeoutValue " ] = sec_to_ms (
487+ process ["startup_config " ] = [{}]
488+ process ["startup_config " ][0 ]["execution_error " ] = "1"
489+ process ["startup_config " ][0 ]["identifier" ] = f"{ component_name } _startup_config"
490+ process ["startup_config " ][0 ]["enter_timeout_value " ] = sec_to_ms (
489491 component_config ["deployment_config" ]["ready_timeout" ]
490492 )
491- process ["startupConfig " ][0 ]["exitTimeoutValue " ] = sec_to_ms (
493+ process ["startup_config " ][0 ]["exit_timeout_value " ] = sec_to_ms (
492494 component_config ["deployment_config" ]["shutdown_timeout" ]
493495 )
494- process ["startupConfig " ][0 ]["schedulingPolicy " ] = component_config [
496+ process ["startup_config " ][0 ]["scheduling_policy " ] = component_config [
495497 "deployment_config"
496498 ]["sandbox" ]["scheduling_policy" ]
497- process ["startupConfig " ][0 ]["schedulingPriority " ] = str (
499+ process ["startup_config " ][0 ]["scheduling_priority " ] = str (
498500 component_config ["deployment_config" ]["sandbox" ]["scheduling_priority" ]
499501 )
500- process ["startupConfig " ][0 ]["terminationBehavior " ] = get_terminating_behavior (
502+ process ["startup_config " ][0 ]["termination_behavior " ] = get_terminating_behavior (
501503 component_config
502504 )
503- process ["startupConfig " ][0 ]["processGroupStateDependency " ] = []
504- process ["startupConfig " ][0 ]["environmentVariable " ] = []
505+ process ["startup_config " ][0 ]["process_group_state_dependency " ] = []
506+ process ["startup_config " ][0 ]["environment_variable " ] = []
505507 for env_var , value in (
506508 component_config ["deployment_config" ]
507509 .get ("environmental_variables" , {})
508510 .items ()
509511 ):
510- process ["startupConfig " ][0 ]["environmentVariable " ].append (
512+ process ["startup_config " ][0 ]["environment_variable " ].append (
511513 {"key" : env_var , "value" : value }
512514 )
513515 application_type = component_config ["component_properties" ][
514516 "application_profile"
515517 ]["application_type" ]
516518 if is_supervised (application_type ):
517- process ["startupConfig " ][0 ]["environmentVariable " ].append (
519+ process ["startup_config " ][0 ]["environment_variable " ].append (
518520 {
519521 "key" : "LCM_ALIVE_INTERFACE_PATH" ,
520522 "value" : "lifecycle_health_" + component_name ,
@@ -525,28 +527,28 @@ def get_terminating_behavior(component_config):
525527 "process_arguments" , []
526528 ):
527529 arguments = [{"argument" : arg } for arg in arguments ]
528- process ["startupConfig " ][0 ]["processArgument " ] = arguments
530+ process ["startup_config " ][0 ]["process_argument " ] = arguments
529531
530532 if component_name in process_group_states :
531533 for pgstate in process_group_states [component_name ]:
532- process ["startupConfig " ][0 ]["processGroupStateDependency " ].append (
533- {"stateMachine_name " : "MainPG" , "stateName " : pgstate }
534+ process ["startup_config " ][0 ]["process_group_state_dependency " ].append (
535+ {"state_machine_name " : "MainPG" , "state_name " : pgstate }
534536 )
535537
536- lm_config ["Process " ].append (process )
538+ lm_config ["process " ].append (process )
537539
538540 # Execution dependencies. Assumption: Components can never depend on run targets
539- for process in lm_config ["Process " ]:
540- process ["startupConfig " ][0 ]["executionDependency " ] = []
541+ for process in lm_config ["process " ]:
542+ process ["startup_config " ][0 ]["execution_dependency " ] = []
541543 for dependency in config ["components" ][process ["identifier" ]][
542544 "component_properties"
543545 ].get ("depends_on" , []):
544546 dep_entry = config ["components" ][dependency ]
545547 ready_condition = dep_entry ["component_properties" ]["ready_condition" ][
546548 "process_state"
547549 ]
548- process ["startupConfig " ][0 ]["executionDependency " ].append (
549- {"stateName " : ready_condition , "targetProcess_identifier " : dependency }
550+ process ["startup_config " ][0 ]["execution_dependency " ].append (
551+ {"state_name " : ready_condition , "target_process_identifier " : dependency }
550552 )
551553
552554 with open (f"{ output_dir } /lm_demo.json" , "w" ) as lm_file :
0 commit comments