Write instance-data.json file if absent and datasource is restored.
(init: stages.Init)
| 1033 | |
| 1034 | |
| 1035 | def _maybe_persist_instance_data(init: stages.Init): |
| 1036 | """Write instance-data.json file if absent and datasource is restored.""" |
| 1037 | if init.datasource and init.ds_restored: |
| 1038 | instance_data_file = init.paths.get_runpath("instance_data") |
| 1039 | if not os.path.exists(instance_data_file): |
| 1040 | init.datasource.persist_instance_data(write_cache=False) |
| 1041 | |
| 1042 | |
| 1043 | def _maybe_set_hostname(init, stage, retry_stage): |
no test coverage detected