summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-10-22 21:02:42 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-10-25 08:42:15 -0400
commitcfe3e4424efbf16d56a7570af0579ef574fd74f6 (patch)
treeb177d2e02632e1766a24f9ba9fad2e5e2b2bc1d9
parentdb27894204a630a675b74aab8021ca5d5d8c45b2 (diff)
downloadphosphor-objmgr-cfe3e4424efbf16d56a7570af0579ef574fd74f6.tar.gz
phosphor-objmgr-cfe3e4424efbf16d56a7570af0579ef574fd74f6.zip
python-mapper: Accept service-namespaces
The c++ mapper implements a dbus service namespace whitelist instead of a path namespace whitelist. A service namespace whitelist significantly reduces the amount of introspection required by the mapper as compared to path namespaces. Update the python mapper to accept the new command line arguments. This is entirely throw-away code to reduce corequisites as users (OpenBMC) transition to the c++ mapper. As such, no logic is implemented behind the new command line options. Change-Id: Ic952e85dbd44e850059e67a3675ddbf1dd2f15b1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r--obmc/mapper/server.py11
-rw-r--r--phosphor-mapper8
2 files changed, 17 insertions, 2 deletions
diff --git a/obmc/mapper/server.py b/obmc/mapper/server.py
index 9f8d717..29a65a4 100644
--- a/obmc/mapper/server.py
+++ b/obmc/mapper/server.py
@@ -195,8 +195,9 @@ class Manager(obmc.dbuslib.bindings.DbusObjectManager):
class ObjectMapper(dbus.service.Object):
def __init__(
- self, bus, path, namespaces, interface_namespaces,
- blacklist, interface_blacklist):
+ self, bus, path, namespaces, service_namespaces,
+ interface_namespaces, blacklist, service_blacklist,
+ interface_blacklist):
super(ObjectMapper, self).__init__(bus, path)
self.cache = obmc.utils.pathtree.PathTree()
self.bus = bus
@@ -206,9 +207,11 @@ class ObjectMapper(dbus.service.Object):
self.bus_map = {}
self.defer_signals = {}
self.namespaces = namespaces
+ self.service_namespaces = service_namespaces
self.interface_namespaces = interface_namespaces
self.blacklist = blacklist
self.blacklist.append(obmc.mapper.MAPPER_PATH)
+ self.service_blacklist = service_blacklist
self.interface_blacklist = interface_blacklist
# add my object mananger instance
@@ -779,8 +782,10 @@ class ObjectMapper(dbus.service.Object):
def server_main(
path_namespaces,
+ service_namespaces,
interface_namespaces,
blacklists,
+ service_blacklists,
interface_blacklists):
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
@@ -788,8 +793,10 @@ def server_main(
bus,
obmc.mapper.MAPPER_PATH,
path_namespaces,
+ service_namespaces,
interface_namespaces,
blacklists,
+ service_blacklists,
interface_blacklists)
loop = gobject.MainLoop()
diff --git a/phosphor-mapper b/phosphor-mapper
index 4e28c1c..25d9867 100644
--- a/phosphor-mapper
+++ b/phosphor-mapper
@@ -26,12 +26,18 @@ if __name__ == '__main__':
'-p', '--path_namespaces',
required=True)
parser.add_argument(
+ '-s', '--service_namespaces',
+ default="")
+ parser.add_argument(
'-i', '--interface_namespaces',
required=True)
parser.add_argument(
'-b', '--blacklists',
default="")
parser.add_argument(
+ '-x', '--service_blacklists',
+ default="")
+ parser.add_argument(
'-n', '--interface_blacklists',
default="")
@@ -40,6 +46,8 @@ if __name__ == '__main__':
sys.exit(
obmc.mapper.server.server_main(
path_namespaces=args.path_namespaces.split(),
+ service_namespaces=args.service_namespaces.split(),
interface_namespaces=args.interface_namespaces.split(),
blacklists=args.blacklists.split(),
+ service_blacklists=args.service_blacklists.split(),
interface_blacklists=args.interface_blacklists.split()))
OpenPOWER on IntegriCloud