Type issues in drivers (filesystem and VMware)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glance_store |
Fix Released
|
Undecided
|
Cyril Roelandt |
Bug Description
The _get_datadir_
- the caller must cast the result to an integer
- the code is harder to read
- static checkers such as mypy have a hard time processing these methods
Running mypy shows the issue:
$ mypy glance_
...
glance_
$ mypy glance_
...
glance_
This happens because the "priority" and "weight" variables are initialized using an integer, and are later assigned to a string. Obviously, mypy is a bit too strong, but following its recommendations make the code much clearer.
Changed in glance-store: | |
assignee: | nobody → Cyril Roelandt (cyril-roelandt) |
Changed in glance-store: | |
status: | New → In Progress |
Fix proposed to master branch, https:/ /review. openstack. org/#/c/ 631994