
24 Feb
2021
24 Feb
'21
3:20 p.m.
+4.需要对输出的error_id中含有的特殊字符进行处理。 + - 单引号,空格,冒号等
1. 定义一个白名单。名单之外的字符,统统替换为'-'. 2. 各种数字,统统替换为'#'. 3. 连续的-, #替换为单个
+ def common_error_id(line) + line = line.chomp + line.gsub!(/ /, '-') + line.gsub!(/:/, '') # error.:-'__mysql_packages'-is-undefined: 1 + line.gsub!(/,/, '') + line.gsub!(/'/, '') # Failed-to-download-metadata-for-repo-'dockerrepo: 1 + line.gsub!(/!/, '') # Distribution-openEuler-is-not-supported-by-this-role!: 1 + line.gsub!(/{%/, ' ') + line.gsub!(/%}/, ' ') + line + end -- 2.23.0