Closed edwintorok closed 6 years ago
The errors are:
'<>' is deprecated, use '!='
, that should be fixed before merging this PR
Some pylint general complaint that can be fixed running autopep8 -i
on the code.
Some issues of the type: 'Rpc_light_failure' may be undefined, or defined from star imports: xapi
, that can be fixed adding named imports instead of wildcards (there are not many of those if remove duplicats)
Some type comparisons done as type(a) <> type(b)
. This is wrong, it would be better to do something like isinstance(a, b)
or type(a) is not type(b)
instead, but it depends on the case.
I think these are all from the auto-generated code, I'll try to fix the code generator and regenerate it than manually fix the output.
Thanks! I think we can live without the aesthetic fixes, but the comparisons need to be fixed
Let’s run pyflake with —ignore E201,E202,E301,E501
And fix the remaining redefinition warnings
Still testing the latest fixup, will post an update when its ready for another round review.
Should be better now, the _test
class is not actually used, thought we could use them in xapi-storage-script's unit tests, but there are several things to fix first before it'd work (e.g. Plugin.query
test class returns a json object wrapped in a query_result
field, whereas it should just return the inner dict), so I think we should do that as part of the RPC rework to support multiple APIs.
Should we delete it for the time being? (it probably would be enough to comment the code that generates that part until it's fixed)
Not sure whether anything else uses it somewhere, I'd keep it for now.
If it's broken I wonder how whatever uses it is not failing miserably
Feel free to squash the fixups and merge, please open a CA ticket about this broken test class
Unless you preemptively set it differently, the logging
module defaults to warning level and will discard all the logging.info
calls
Sorry, missed this comment earlier, I used logging.basicConfig
with loglevel set to debug when attempting to write a unit test, before I hit CA-284338.
Rebased and squashed the fixups, checked that there were no differences in the code except history: git diff d96112b..fc4355e
The already shipped supp-pack with the tmpfs SR imports a python library from the installed host. If we update the host without updating the supp-pack we need to keep the python library backward compatible.
The short-term fix is to keep the old library as was, and put the new library into a different module. In the future the code generator can be updated to generate a single python module that is compatible with all the APIs.
Need to be merged together with: https://github.com/xapi-project/xapi-storage-script/pull/57 (and the internal PR on the spec files)