This is the main flow for creating/updating instances within the instance template context.
(self)
| 460 | |
| 461 | # Tested |
| 462 | def instance_template_main(self): |
| 463 | """ |
| 464 | This is the main flow for creating/updating |
| 465 | instances within the instance template context. |
| 466 | |
| 467 | """ |
| 468 | |
| 469 | if not self.instance_list_new: |
| 470 | logger.error(f"Error, please provide instance_list_new {str(self.log)}") |
| 471 | return None |
| 472 | |
| 473 | # Remove requirement for label_file_id in this case |
| 474 | for elm in self.per_instance_spec_list: |
| 475 | if 'label_file_id' in elm: |
| 476 | elm['label_file_id']['required'] = False |
| 477 | |
| 478 | self.update_instance_list(hash_instances = False, |
| 479 | validate_label_file = False, |
| 480 | overwrite_existing_instances = True) |
| 481 | |
| 482 | if len(self.log["error"].keys()) >= 1: |
| 483 | logger.error(f"Error updating annotation {str(self.log)}") |
| 484 | logger.error(f"Instance list is: {self.instance_list_new}") |
| 485 | return self.return_orginal_file_type() |
| 486 | |
| 487 | return self.new_added_instances |
| 488 | |
| 489 | # Tested |
| 490 | def __check_all_instances_available_in_new_instance_list(self): |