utils: provide dbus match strings
Provide a list of name filters, suitable for use with dbus
interface/path name matching.
Change-Id: I47a3be43e4460e35ec457436300fac82eb18a03f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/obmc/utils/misc.py b/obmc/utils/misc.py
index 6071eec..d556dfd 100644
--- a/obmc/utils/misc.py
+++ b/obmc/utils/misc.py
@@ -14,14 +14,18 @@
# implied. See the License for the specific language governing
# permissions and limitations under the License.
-
-def org_dot_openbmc_match(name, sep='.'):
+def org_dot_openbmc_match_strings(sep='.'):
matches = [
['org', 'openbmc'],
- ['xyz', 'openbmc-project'],
+ ['xyz', 'openbmc_project'],
]
+
+ return [sep.join(y) for y in matches]
+
+
+def org_dot_openbmc_match(name, sep='.'):
return any(
- [x in name for x in [ sep.join(y) for y in matches]])
+ [x in name for x in org_dot_openbmc_match_strings(sep)])
class ListMatch(object):