forked from keylime/keylime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Pylint plugin not found error and some lingering Pylint warnings
Signed-off-by: Jean Snyman <git@jsnyman.com>
- Loading branch information
1 parent
7d8a4ee
commit 55eacb9
Showing
4 changed files
with
15 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
from keylime.models.base.da import da_manager | ||
from keylime.models.base.db import db_manager | ||
from keylime.models.registrar import * | ||
# Checks whether script is being invoked by tox in a virtual environment | ||
def is_tox_env(): | ||
# Import 'os' inside function to avoid polluting the namespace of any module which imports 'keylime.models' | ||
import os # pylint: disable=import-outside-toplevel | ||
|
||
# from keylime.models.verifier import * | ||
return bool(os.environ.get("TOX_ENV_NAME")) | ||
|
||
|
||
# Only perform automatic imports of submodules if tox is not being used to perform static checks. This is necessary as | ||
# models like RegistrarAgent indirectly import package 'gpg' which is not available in a tox environment as it is | ||
# installed via the system package manager | ||
if not is_tox_env(): | ||
from keylime.models.base.da import da_manager | ||
from keylime.models.base.db import db_manager | ||
from keylime.models.registrar import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters