Skip to content

Commit

Permalink
Move lint check to a job
Browse files Browse the repository at this point in the history
Move pylint check to a job so it doesn't block
functional tests.

Fixed a few newly introduced lint warnings as well.
  • Loading branch information
kaifeng authored and mpeters committed Jan 14, 2021
1 parent ac9cfc9 commit 34f2a3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ before_install:
- sudo pip3 install pylint --upgrade
- sudo pip3 install tornado-requests
- sudo pip3 install -r requirements.txt
- make check
- 'docker pull ${tpm12image}:${tpm12tag}'
- 'docker pull ${tpm20image}:${tpm20tag}'

script:
# Lint Checks
- make check
# Run TPM 2.0 Tests
- docker run --detach --privileged -v $(pwd):/root/keylime -v /sys/fs/cgroup:/sys/fs/cgroup:ro ${tpm20image}:${tpm20tag} > ${container_id}
- docker exec -u 0 -it --tty "$(cat ${container_id})" /bin/bash /root/keylime/.ci/test_wrapper.sh
Expand Down
14 changes: 8 additions & 6 deletions keylime/registrar_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ def do_PUT(self):
try:
agent = session.query(RegistrarMain).filter_by(
agent_id=agent_id).first()
except NoResultFound:
raise Exception("attempting to activate agent before "
"requesting registrar for %s" % agent_id)
except NoResultFound as e:
raise Exception(
"attempting to activate agent before requesting "
"registrar for %s" % agent_id) from e
except SQLAlchemyError as e:
logger.error(f'SQLAlchemy Error: {e}')
raise
Expand Down Expand Up @@ -372,9 +373,10 @@ def do_PUT(self):
try:
agent = session.query(RegistrarMain).filter_by(
agent_id=agent_id).first()
except NoResultFound:
raise Exception("attempting to activate agent before "
"requesting registrar for %s" % agent_id)
except NoResultFound as e:
raise Exception(
"attempting to activate agent before requesting "
"registrar for %s" % agent_id) from e
except SQLAlchemyError as e:
logger.error(f'SQLAlchemy Error: {e}')
raise
Expand Down

0 comments on commit 34f2a3f

Please sign in to comment.