Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat Output for Errors by TaskFactory #20

Open
gabrieleiannetti opened this issue Dec 13, 2022 · 0 comments
Open

Reformat Output for Errors by TaskFactory #20

gabrieleiannetti opened this issue Dec 13, 2022 · 0 comments

Comments

@gabrieleiannetti
Copy link
Contributor

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'])'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant