Remove the interfaces removed handler
Now that the delete and delete-all interfaces are implemented,
the interfaces removed signal handler is no longer needed to
know when to delete objects.
In fact, it breaks the REST server because on a Delete call
the following would happen:
1) The server calls Delete on the logging entry in
xyz.openbmc_project.Logging.
2) The removal of that object would call our interfaces
removed handler, which would delete our logging object.
3) The REST server would try to call Delete on our object
and would fail because we already deleted it.
Resolves openbmc/openbmc#3120
Change-Id: Ibfa1faacb0ff27cd7e7e92e35bfd0f972020d361
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/manager.cpp b/manager.cpp
index 45982fc..60d26ef 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -29,12 +29,7 @@
sdbusplus::bus::match::rules::interfacesAdded() +
sdbusplus::bus::match::rules::path_namespace(LOGGING_PATH),
std::bind(std::mem_fn(&Manager::interfaceAdded), this,
- std::placeholders::_1)),
- removeMatch(bus,
- sdbusplus::bus::match::rules::interfacesRemoved() +
- sdbusplus::bus::match::rules::path_namespace(LOGGING_PATH),
- std::bind(std::mem_fn(&Manager::interfaceRemoved), this,
- std::placeholders::_1))
+ std::placeholders::_1))
#ifdef USE_POLICY_INTERFACE
,
policies(POLICY_JSON_PATH)
@@ -150,29 +145,5 @@
create(path, propertyMap->second);
}
}
-
-void Manager::interfaceRemoved(sdbusplus::message::message& msg)
-{
- sdbusplus::message::object_path path;
- DbusInterfaceList interfaces;
-
- msg.read(path, interfaces);
-
- // If the Logging.Entry interface was removed, then remove
- // our object
-
- auto i = std::find(interfaces.begin(), interfaces.end(), LOGGING_IFACE);
-
- if (i != interfaces.end())
- {
- auto id = getEntryID(path);
-
- auto entry = entries.find(id);
- if (entry != entries.end())
- {
- entries.erase(entry);
- }
- }
-}
}
}
diff --git a/manager.hpp b/manager.hpp
index 0320b0c..d09d103 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -66,16 +66,6 @@
void interfaceAdded(sdbusplus::message::message& msg);
/**
- * The callback for an interfaces removed signal
- *
- * Removes the IBM interfaces for the log entry
- * that was just removed.
- *
- * @param[in] msg - the sdbusplus message
- */
- void interfaceRemoved(sdbusplus::message::message& msg);
-
- /**
* Creates the IBM interfaces for all existing error log
* entries.
*/
@@ -145,11 +135,6 @@
*/
sdbusplus::bus::match_t addMatch;
- /**
- * The match object for interfacesRemoved
- */
- sdbusplus::bus::match_t removeMatch;
-
using EntryID = uint32_t;
using InterfaceMap = std::map<InterfaceType, std::experimental::any>;
using EntryMap = std::map<EntryID, InterfaceMap>;