make test: ImportError: No module named http

Bug #1868241 reported by Joe Guo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Elasticsearch Charm
Fix Released
Low
Joe Guo

Bug Description

`make test` will fail with:

> $ make test [±master ●]
Starting unit tests...
Traceback (most recent call last):
  File "unit_tests/test_hooks.py", line 20, in <module>
    from hooks import hooks
  File "/home/guoqiao/charms/elasticsearch/hooks/hooks.py", line 3, in <module>
    import http
ImportError: No module named http
Makefile:12: recipe for target 'test' failed
make: *** [test] Error 1

A few issues here:
1. `http` is builtin lib in python3, but not in python2
2. according to Makefile, `make test` will run tests with python2
3. in `hooks.py`, the only place using `http` module is for a `HTTPStatus.OK` code(200), which could be easily avoided.

Joe Guo (guoqiao)
Changed in charm-elasticsearch:
importance: Undecided → Low
assignee: nobody → Joe Guo (guoqiao)
status: New → In Progress
Alvaro Uria (aluria)
Changed in charm-elasticsearch:
status: In Progress → Fix Committed
milestone: none → 20.05
Jeremy Lounder (jldev)
Changed in charm-elasticsearch:
status: Fix Committed → Fix Released
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.