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 10
10
parse_device_info ,
11
11
parse_if_attributes ,
12
12
main ,
13
- SMARTMON_ATTRS
13
+ SMARTMON_ATTRS ,
14
+ camel_to_snake
14
15
)
15
16
16
17
def load_json_fixture (filename ):
@@ -158,8 +159,7 @@ def _test_parse_if_attributes(self, fixture_name):
158
159
# For each numeric attribute in JSON, if it's in SMARTMON_ATTRS,
159
160
# we expect a line in the script's output.
160
161
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 )
163
163
164
164
if isinstance (attr_val , (int , float )) and snake_key in SMARTMON_ATTRS :
165
165
# We expect e.g. critical_warning{disk="/dev/..."} <value>
You can’t perform that action at this time.
0 commit comments