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/user_mgr.hpp b/user_mgr.hpp
index 4c24201..b25e9f2 100644
--- a/user_mgr.hpp
+++ b/user_mgr.hpp
@@ -33,6 +33,9 @@
using AccountPolicyIface =
sdbusplus::xyz::openbmc_project::User::server::AccountPolicy;
+using Ifaces =
+ sdbusplus::server::object::object<UserMgrIface, AccountPolicyIface>;
+
using Privilege = std::string;
using GroupList = std::vector<std::string>;
using UserEnabled = bool;
@@ -59,7 +62,7 @@
/** @class UserMgr
* @brief Responsible for managing user accounts over the D-Bus interface.
*/
-class UserMgr : public UserMgrIface, AccountPolicyIface
+class UserMgr : public Ifaces
{
public:
UserMgr() = delete;