summaryrefslogtreecommitdiff
path: root/redfish-core/lib/account_service.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2020-07-25 22:02:03 +0300
committerEd Tanous <ed@tanous.net>2020-08-17 23:54:37 +0300
commitcb13a39253848ece442971301ade9c09d98bf08e (patch)
tree62f2a64fbc98d8ee635a0a81f3ef07afa541981d /redfish-core/lib/account_service.hpp
parent23a21a1cbed23ace4174664950e595df961e9e69 (diff)
downloadbmcweb-cb13a39253848ece442971301ade9c09d98bf08e.tar.xz
Enable unused variable warnings and resolve
This commit enables the "unused variables" warning in clang. Throughout this, it did point out several issues that would've been functional bugs, so I think it was worthwhile. It also cleaned up several unused variable from old constructs that no longer exist. Tested: Built with clang. Code no longer emits warnings. Downloaded bmcweb to system and pulled up the webui, observed webui loads and logs in properly. Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8 Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'redfish-core/lib/account_service.hpp')
-rw-r--r--redfish-core/lib/account_service.hpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index b8517b4a35..fae181ce89 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -965,8 +965,6 @@ class AccountService : public Node
void handleLDAPPatch(nlohmann::json& input,
const std::shared_ptr<AsyncResp>& asyncResp,
- const crow::Request& req,
- const std::vector<std::string>& params,
const std::string& serverType)
{
std::string dbusObjectPath;
@@ -978,6 +976,10 @@ class AccountService : public Node
{
dbusObjectPath = ldapConfigObjectName;
}
+ else
+ {
+ return;
+ }
std::optional<nlohmann::json> authentication;
std::optional<nlohmann::json> ldapService;
@@ -1121,8 +1123,8 @@ class AccountService : public Node
});
}
- void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>&) override
{
const persistent_data::AuthConfigMethods& authMethodsConfig =
persistent_data::SessionStore::getInstance().getAuthMethodsConfig();
@@ -1210,6 +1212,10 @@ class AccountService : public Node
auto callback = [asyncResp](bool success, LDAPConfigData& confData,
const std::string& ldapType) {
+ if (!success)
+ {
+ return;
+ }
parseLDAPConfigData(asyncResp->res.jsonValue, confData, ldapType);
};
@@ -1218,7 +1224,7 @@ class AccountService : public Node
}
void doPatch(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -1252,7 +1258,7 @@ class AccountService : public Node
if (ldapObject)
{
- handleLDAPPatch(*ldapObject, asyncResp, req, params, "LDAP");
+ handleLDAPPatch(*ldapObject, asyncResp, "LDAP");
}
if (std::optional<nlohmann::json> oemOpenBMCObject;
@@ -1273,7 +1279,7 @@ class AccountService : public Node
if (activeDirectoryObject)
{
- handleLDAPPatch(*activeDirectoryObject, asyncResp, req, params,
+ handleLDAPPatch(*activeDirectoryObject, asyncResp,
"ActiveDirectory");
}
@@ -1337,7 +1343,7 @@ class AccountsCollection : public Node
private:
void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
res.jsonValue = {{"@odata.id", "/redfish/v1/AccountService/Accounts"},
@@ -1393,7 +1399,7 @@ class AccountsCollection : public Node
"org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
}
void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -1886,7 +1892,7 @@ class ManagerAccount : public Node
});
}
- void doDelete(crow::Response& res, const crow::Request& req,
+ void doDelete(crow::Response& res, const crow::Request&,
const std::vector<std::string>& params) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);