-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Context: commit "WIP xcp.repository: switch from ConfigParser to configparser" in #17 (current shortcut: ydirson@6667fef). When adding python3 compatibility, we see some Accessor implementations (e.g. FileAccessor) provide a text stream, while others (e.g. HTTPAccessor) provide a binary
stream. This is a problem for code written to be compatible with arbitrary Accessor implementations, as demonstrated in additional unit tests in commits WIP test_accessor: check for I/O on binary files and WIP test_accessor: write into copy file as binary.
To be in line with file-opening conventions, Accessor.openAddress() should be made to accept a mode argument so client code can get what it expects without a need for hacks such as illustrated above. To make sure not-yet-reviewed/converted client code is caught red-handed, I would rather add this parameter as mandatory.
Identified client code to be reviewed/adjusted in lockstep include:
- XAPI plugin
prepare_host_upgrade(not in any public repo yet ?) xcp.repository(internal dependency, not a problem)
Additionally, https://github.com/xenserver/host-installer contains a forked version of this code in repository.py (itself an advanced fork of xcp.repository).