hv_xen: Factorize and test disk configuration
authorMichael Hanselmann <hansmi@google.com>
Tue, 22 Jan 2013 12:31:25 +0000 (13:31 +0100)
committerMichael Hanselmann <hansmi@google.com>
Thu, 24 Jan 2013 12:27:11 +0000 (13:27 +0100)
commitd0bb3f2463e1a1fe0cbe01e952856d6f01ac7dcb
treeb62a9a5cb952d97c007ae4b998fd01bd3a8d6e70
parent06c9a52082019477c4f24229a1817486fb347b61
hv_xen: Factorize and test disk configuration

The “_GetConfigFileDiskData” function is moved to module level and
cleaned up (module-level constants for letters and file I/O drivers).

Until now only 24 disks would be supported (e.g. “sda” to “sdx”), when
the Latin alphabet actually has 26 characters. Now all 26 letters would
be available for use (“constants.MAX_DISKS” is still 16).

Newly added unit tests provide complete coverage for
“_GetConfigFileDiskData”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
lib/hypervisor/hv_xen.py
test/py/ganeti.hypervisor.hv_xen_unittest.py