File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
etc/kayobe/ansible/scripts Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1010 parse_device_info ,
1111 parse_if_attributes ,
1212 main ,
13- SMARTMON_ATTRS
13+ SMARTMON_ATTRS ,
14+ camel_to_snake
1415)
1516
1617def load_json_fixture (filename ):
@@ -158,8 +159,7 @@ def _test_parse_if_attributes(self, fixture_name):
158159 # For each numeric attribute in JSON, if it's in SMARTMON_ATTRS,
159160 # we expect a line in the script's output.
160161 for attr_key , attr_val in if_attrs .items ():
161- # Convert from e.g. "criticalWarning" -> "critical_warning"
162- snake_key = re .sub (r'(?<!^)(?=[A-Z])' , '_' , attr_key ).lower ()
162+ snake_key = camel_to_snake (attr_key )
163163
164164 if isinstance (attr_val , (int , float )) and snake_key in SMARTMON_ATTRS :
165165 # We expect e.g. critical_warning{disk="/dev/..."} <value>
You can’t perform that action at this time.
0 commit comments