objects: Improve handling of TCP/UDP port pool
authorMichael Hanselmann <hansmi@google.com>
Mon, 4 Feb 2013 13:00:40 +0000 (14:00 +0100)
committerMichael Hanselmann <hansmi@google.com>
Mon, 4 Feb 2013 14:22:59 +0000 (15:22 +0100)
commit4d36fbf424c758a58e10e49e12b54c572350db01
tree70a751e58beb7f7f03a2553bcebfc0986d51650a
parent35e18c3814d7f2756a7d822d639066d446d33a08
objects: Improve handling of TCP/UDP port pool

- Handle de-serialization correctly when pool is not defined
- Serialize to empty list when the attribute is None (this should never
  happen in reality as the attribute is always set when de-serializing)
- Add tests

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/objects.py
test/py/ganeti.objects_unittest.py