diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-09-15 15:37:02 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-09-20 21:31:20 -0400 |
commit | 25af4ba816330a24b83d2436f2008991b25f55e4 (patch) | |
tree | dd94c7070b10606ad9e43e18851fe8eb62175901 | |
parent | d874f0b030e54b86a4cb14b8699853bf6d0d21d0 (diff) | |
download | pyphosphor-25af4ba816330a24b83d2436f2008991b25f55e4.tar.gz pyphosphor-25af4ba816330a24b83d2436f2008991b25f55e4.zip |
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>
-rw-r--r-- | obmc/utils/misc.py | 12 |
1 files changed, 8 insertions, 4 deletions
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): |