Skip to content

Commit

Permalink
Avoid repeated restart snap service. (#386)
Browse files Browse the repository at this point in the history
The snap service will be restarted at the config_changed event, so it's
not necessary to restart in the strategy class.
  • Loading branch information
chanchiwai-ray authored Jan 12, 2025
1 parent 0588d1b commit 476b66a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/hw_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ def _create_custom_metrics(self) -> None:
try:
shutil.copy(self.metric_file, self.snap_common)
self.snap_client.set({"dcgm-exporter-metrics-file": self.metric_file.name})
self.snap_client.restart(reload=True)
except Exception as err: # pylint: disable=broad-except
logger.error("Failed to configure custom DCGM metrics: %s", err)
raise err
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_hw_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,6 @@ def test_dcgm_create_custom_metrics(dcgm_exporter_strategy, mock_shutil_copy, mo
dcgm_exporter_strategy.snap_client.set.assert_called_once_with(
{"dcgm-exporter-metrics-file": "dcgm_metrics.csv"}
)
dcgm_exporter_strategy.snap_client.restart.assert_called_once_with(reload=True)


def test_dcgm_create_custom_metrics_copy_fail(
Expand Down

0 comments on commit 476b66a

Please sign in to comment.