From 36b9966199d930186bb0e9bfd17900cf421296ca Mon Sep 17 00:00:00 2001 From: jamesbeedy Date: Sat, 30 Nov 2024 18:21:35 +0000 Subject: [PATCH] use CommaSeparatorCallback for SysFsInterfaces --- slurmutils/models/option.py | 2 +- tests/unit/editors/test_acctgatherconfig.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/slurmutils/models/option.py b/slurmutils/models/option.py index 84cb347..7ca6611 100644 --- a/slurmutils/models/option.py +++ b/slurmutils/models/option.py @@ -71,7 +71,7 @@ class AcctGatherConfigOptionSet(_OptionSet): ProfileInfluxDBUser: Callback = Callback() ProfileInfluxDBTimeout: Callback = Callback() InfinibandOFEDPort: Callback = Callback() - SysfsInterfaces: Callback = Callback() + SysfsInterfaces: Callback = CommaSeparatorCallback @dataclass(frozen=True) diff --git a/tests/unit/editors/test_acctgatherconfig.py b/tests/unit/editors/test_acctgatherconfig.py index 7fe9234..257382b 100644 --- a/tests/unit/editors/test_acctgatherconfig.py +++ b/tests/unit/editors/test_acctgatherconfig.py @@ -51,7 +51,7 @@ def test_loads(self) -> None: self.assertEqual(config.profile_influx_db_user, "testuser") self.assertEqual(config.profile_influx_db_timeout, "10") self.assertEqual(config.infiniband_ofed_port, "0") - self.assertEqual(config.sysfs_interfaces, "enp0s1") + self.assertEqual(config.sysfs_interfaces, ["enp0s1"]) config = acctgatherconfig.loads(EXAMPLE_ACCT_GATHER_CONFIG) # The new config and old config should not be equal since the @@ -81,7 +81,7 @@ def test_edit(self) -> None: config.profile_influx_db_user = "testuser1" config.profile_influx_db_timeout = "20" config.infiniband_ofed_port = "1" - config.sysfs_interfaces = "enp0s2" + config.sysfs_interfaces = ["enp0s2"] config = acctgatherconfig.load("/etc/slurm/acct_gather.conf") self.assertEqual(config.energy_ipmi_frequency, "2") @@ -103,4 +103,4 @@ def test_edit(self) -> None: self.assertEqual(config.profile_influx_db_user, "testuser1") self.assertEqual(config.profile_influx_db_timeout, "20") self.assertEqual(config.infiniband_ofed_port, "1") - self.assertEqual(config.sysfs_interfaces, "enp0s2") + self.assertEqual(config.sysfs_interfaces, ["enp0s2"])