|
12 | 12 | from openstack.config import loader |
13 | 13 |
|
14 | 14 | from .entities import WorkloadGeneratorDomain |
15 | | -from .entities.helpers import setup_logging, cloud_checker, item_checker, Config |
| 15 | +from .entities.helpers import setup_logging, cloud_checker, item_checker, Config, iso_timestamp, deep_merge_dict |
16 | 16 |
|
17 | 17 | LOGGER = logging.getLogger() |
18 | 18 |
|
@@ -182,12 +182,19 @@ def establish_connection(): |
182 | 182 | LOGGER.info(f"Creating a a clouds yaml : {args.generate_clouds_yaml}") |
183 | 183 | clouds_yaml_data_new = {"clouds": clouds_yaml_data} |
184 | 184 | if os.path.exists(args.generate_clouds_yaml): |
185 | | - with open(args.generate_clouds_yaml, 'r') as file: |
| 185 | + with open(args.generate_clouds_yaml, "r") as file: |
186 | 186 | existing_data = yaml.safe_load(file) |
187 | | - backup_file=f"{args.generate_clouds_yaml}_{iso_timestamp()}" |
188 | | - logging.warning(f"File {args.generate_clouds_yaml}, making an backup to {backup_file} and adding the new values") |
189 | | - shutil.copy2(args.generate_clouds_yaml, f"{args.generate_clouds_yaml}_{iso_timestamp()}") |
190 | | - clouds_yaml_data_new = deep_merge_dict(existing_data,clouds_yaml_data_new) |
| 187 | + backup_file = f"{args.generate_clouds_yaml}_{iso_timestamp()}" |
| 188 | + logging.warning( |
| 189 | + f"File {args.generate_clouds_yaml}, making an backup to {backup_file} and adding the new values" |
| 190 | + ) |
| 191 | + shutil.copy2( |
| 192 | + args.generate_clouds_yaml, |
| 193 | + f"{args.generate_clouds_yaml}_{iso_timestamp()}", |
| 194 | + ) |
| 195 | + clouds_yaml_data_new = deep_merge_dict( |
| 196 | + existing_data, clouds_yaml_data_new |
| 197 | + ) |
191 | 198 |
|
192 | 199 | with open(args.generate_clouds_yaml, "w") as file: |
193 | 200 | yaml.dump( |
|
0 commit comments