diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-09-19 10:58:46 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-09-20 21:31:31 -0400 |
commit | b00a989bc4e0a7148be28af818d29395e62f92c0 (patch) | |
tree | 1cb33ad3c7320e25b4f23af57bf0c1f22545cf4e | |
parent | bf72047d9bbd4d0efe8ef55134c3bc4de8ecea9f (diff) | |
download | pyphosphor-b00a989bc4e0a7148be28af818d29395e62f92c0.tar.gz pyphosphor-b00a989bc4e0a7148be28af818d29395e62f92c0.zip |
utils: add prefix
Allow some composition of the strings returned by
org_dot_openbmc_match_strings.
Signed-off-by: Brad Bishop <bradleyb
Change-Id: I8e6a522af175bba70aedbfb4f5a65e06b9237598
-rw-r--r-- | obmc/utils/misc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/obmc/utils/misc.py b/obmc/utils/misc.py index 01ecec1..12d0489 100644 --- a/obmc/utils/misc.py +++ b/obmc/utils/misc.py @@ -14,17 +14,17 @@ # implied. See the License for the specific language governing # permissions and limitations under the License. -def org_dot_openbmc_match_strings(sep='.'): +def org_dot_openbmc_match_strings(sep='.', prefix=''): matches = [ ['org', 'openbmc'], ['xyz', 'openbmc_project'], ] - return [sep.join(y) for y in matches] + return [prefix + sep.join(y) for y in matches] -def org_dot_openbmc_match(name, sep='.'): - names = org_dot_openbmc_match_strings(sep) +def org_dot_openbmc_match(name, sep='.', prefix=''): + names = org_dot_openbmc_match_strings(sep=sep, prefix=prefix) return any( [x in name or name in x for x in names]) |