Skip to content

Commit

Permalink
Make the location of ruleset more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
lachmanfrantisek committed Jan 7, 2022
1 parent bf17960 commit b7b7ae7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion ci.fmf
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
/test/build:
/smoke:
execute:
how: shell
script:
- colin --version
- colin --help
framework: shell
/list-rulesets:
execute:
script:
- sh -c "cd / && colin list-rulesets"
framework: shell
/list-checks:
execute:
script:
- sh -c "cd / && colin list-checks"
framework: shell
3 changes: 2 additions & 1 deletion colin/core/ruleset/ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import logging
import os
import sys

from .loader import (
RulesetStruct,
Expand Down Expand Up @@ -216,7 +217,7 @@ def get_ruleset_dirs():
logger.debug("Local ruleset directory found ('%s').", local_share)
ruleset_dirs.append(local_share)

usr_local_share = os.path.join("/usr/local", RULESET_DIRECTORY)
usr_local_share = os.path.join(sys.prefix, RULESET_DIRECTORY)
if os.path.isdir(usr_local_share):
logger.debug("Global ruleset directory found ('%s').", usr_local_share)
ruleset_dirs.append(usr_local_share)
Expand Down

0 comments on commit b7b7ae7

Please sign in to comment.