Refactor getValidChassisPath
getValidChassisPath shouldn't rely on SensorAsyncResp object. Move
it to utils to wider use.
Tested: Redfish service Validator passed.
Change-Id: I418b7f0f3846fd001392536e2943f062b1bdb5cd
Signed-off-by: Zhenwei Chen <zhenweichen0207@gmail.com>
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index bc18157..cecaeab 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -17,6 +17,7 @@
#pragma once
#include "sensors.hpp"
+#include "utils/chassis_utils.hpp"
#include <app.hpp>
#include <dbus_utility.hpp>
@@ -110,7 +111,9 @@
std::variant<uint32_t>(*value));
});
};
- getValidChassisPath(sensorsAsyncResp, std::move(getChassisPath));
+ redfish::chassis_utils::getValidChassisPath(sensorsAsyncResp->asyncResp,
+ sensorsAsyncResp->chassisId,
+ std::move(getChassisPath));
}
inline void requestRoutesPower(App& app)
{