File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
nodescraper/plugins/inband/dmesg Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,9 @@ def collect_data(
155155 self ._collect_dmesg_rotations ()
156156
157157 if dmesg_content :
158- dmesg_data = DmesgData (dmesg_content = dmesg_content )
158+ dmesg_data = DmesgData (
159+ dmesg_content = dmesg_content , skip_log_file = not args .collect_dmesg_log
160+ )
159161 self .result .message = "Dmesg data collected"
160162 return self .result , dmesg_data
161163
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ class DmesgData(DataModel):
3535 """Data model for in band dmesg log"""
3636
3737 dmesg_content : str
38+ skip_log_file : bool = False
3839
3940 @classmethod
4041 def get_new_dmesg_lines (cls , current_dmesg : str , new_dmesg : str ) -> str :
@@ -83,6 +84,8 @@ def log_model(self, log_path: str):
8384 Args:
8485 log_path (str): log path
8586 """
87+ if self .skip_log_file :
88+ return
8689 log_name = os .path .join (log_path , get_unique_filename (log_path , "dmesg.log" ))
8790 with open (log_name , "w" , encoding = "utf-8" ) as log_file :
8891 log_file .write (self .dmesg_content )
You can’t perform that action at this time.
0 commit comments