'jsonschema' imported but unused

Bug #1695918 reported by Joshua Powers
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

From latest build tests:
tests/unittests/test_handler/test_handler_ntp.py:20: 'jsonschema' imported but unused
tests/unittests/test_handler/test_schema.py:16: 'jsonschema' imported but unused

Steps to reproduce:
# git clone master
# cd cloud-init
# tox -e tip-pyflakes

The offending code in both files is:
    import jsonschema # NOQA
    _missing_jsonschema_dep = False
except ImportError:
    _missing_jsonschema_dep = True

Revision history for this message
Joshua Powers (powersj) wrote :

The NOQA comment does not appear to work across pyflakes and flake8. A better solution is to assert the import right after to avoid needing to make exceptions for both linters & checkers.

My suggestion:

    import jsonschema
    assert jsonschema
    _missing_jsonschema_dep = False

Revision history for this message
Joshua Powers (powersj) wrote :
Changed in cloud-init:
status: New → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 17.1

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.