diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-09-19 10:34:23 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-09-20 21:31:31 -0400 |
commit | bf72047d9bbd4d0efe8ef55134c3bc4de8ecea9f (patch) | |
tree | aca41d3858809d28ad94b4203177a5fba1562c30 | |
parent | 25af4ba816330a24b83d2436f2008991b25f55e4 (diff) | |
download | pyphosphor-bf72047d9bbd4d0efe8ef55134c3bc4de8ecea9f.tar.gz pyphosphor-bf72047d9bbd4d0efe8ef55134c3bc4de8ecea9f.zip |
utils: match parents
Match parents like '/org' in addition to '/org/openbmc/foo' when
testing with org_dot_openbmc_match.
Change-Id: I707f1de0367bfad0de4afa4436b10203c0d7f852
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r-- | obmc/utils/misc.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/obmc/utils/misc.py b/obmc/utils/misc.py index d556dfd..01ecec1 100644 --- a/obmc/utils/misc.py +++ b/obmc/utils/misc.py @@ -24,8 +24,9 @@ def org_dot_openbmc_match_strings(sep='.'): def org_dot_openbmc_match(name, sep='.'): + names = org_dot_openbmc_match_strings(sep) return any( - [x in name for x in org_dot_openbmc_match_strings(sep)]) + [x in name or name in x for x in names]) class ListMatch(object): |