Fix emit interface added signal
Send the interface added signal once the object is fully
populated.
Here we are fixing this behaviour for two D-bus objects
1) Root Dbus object for user manager app.
2) Individual user D-bus object.
Before this fix was getting two signals for creation of user/manager
signal time=1562577322.850104 sender=:1.57 -> destination=(null destination) serial=346
path=/xyz/openbmc_project/user; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
signal time=1562577322.897089 sender=:1.57 -> destination=(null destination) serial=347
path=/xyz/openbmc_project/user; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
After the fix was getting single signal
signal time=1562577775.550198 sender=:1.156 -> destination=(null destination) serial=27
path=/xyz/openbmc_project/user; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
Change-Id: I20ac168fe4fc7cd94cd2032db6ebc1623af5943d
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
diff --git a/users.cpp b/users.cpp
index 84c401d..dafc2dc 100644
--- a/users.cpp
+++ b/users.cpp
@@ -55,15 +55,15 @@
Users::Users(sdbusplus::bus::bus &bus, const char *path,
std::vector<std::string> groups, std::string priv, bool enabled,
UserMgr &parent) :
- UsersIface(bus, path, true),
- DeleteIface(bus, path),
+ Interfaces(bus, path, true),
userName(std::experimental::filesystem::path(path).filename()),
manager(parent)
{
UsersIface::userPrivilege(priv, true);
UsersIface::userGroups(groups, true);
UsersIface::userEnabled(enabled, true);
- UsersIface::emit_object_added();
+
+ this->emit_object_added();
}
/** @brief delete user method.