Skip to content

Reformat Output for Errors by TaskFactory #20

@gabrieleiannetti

Description

@gabrieleiannetti

If TaskFactory fails on object creation the output is not easy to read:

Traceback (most recent call last):
  File "/root/cyclone/core/task/generator/lustre_ost_monitoring_task_generator.py", line 80, in run
    task_list = self._create_task_list(ost_idx_set)
  File "/root/cyclone/core/task/generator/lustre_ost_monitoring_task_generator.py", line 109, in _create_task_list
    task_skeleton = TaskFactory().create_from_xml_info(task_xml_info)
  File "/root/cyclone/core/task/task_factory.py", line 59, in create_from_xml_info
    raise RuntimeError(f"Signature of '{xml_info.class_module}::{xml_info.class_name}"
RuntimeError: Signature of 'task.lustre_file_creation_check_task::LustreFileCreationCheckTask::init(['self', 'ost_idx', 'lfs_target', 'target_base_dir', 'target_mdt_sub_dir', 'mdt_index_rangeset', 'pushgateway_name', 'pushgateway_port', 'pushgateway_timeout'])' does not match XML property list 'odict_keys(['lfs_target', 'target_base_dir', 'target_mdt_sub_dir', 'mdt_index_rangeset', 'ost_idx', 'pushgateway_name', 'pushgateway_port', 'pushgateway_timeout'])'

Better would be something like the following with proper line breaks:

Traceback (most recent call last):
  File "/root/cyclone/core/task/generator/lustre_ost_monitoring_task_generator.py", line 80, in run
    task_list = self._create_task_list(ost_idx_set)
  File "/root/cyclone/core/task/generator/lustre_ost_monitoring_task_generator.py", line 109, in _create_task_list
    task_skeleton = TaskFactory().create_from_xml_info(task_xml_info)
  File "/root/cyclone/core/task/task_factory.py", line 59, in create_from_xml_info
    raise RuntimeError(f"Signature of '{xml_info.class_module}::{xml_info.class_name}"
    
RuntimeError: Signature of 'task.lustre_file_creation_check_task::LustreFileCreationCheckTask::init(['self', 
'ost_idx', 
'lfs_target', 
'target_base_dir', 
'target_mdt_sub_dir', 
'mdt_index_rangeset', 
'pushgateway_name', 
'pushgateway_port', 
'pushgateway_timeout'])' 

does not match XML property list 'odict_keys([
'lfs_target', 
'target_base_dir', 
'target_mdt_sub_dir', 
'mdt_index_rangeset', 
'ost_idx', 
'pushgateway_name', 
'pushgateway_port', 
'pushgateway_timeout'])'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions