Revision 4d36fbf4 lib/objects.py
b/lib/objects.py | ||
---|---|---|
1623 | 1623 |
|
1624 | 1624 |
""" |
1625 | 1625 |
mydict = super(Cluster, self).ToDict() |
1626 |
mydict["tcpudp_port_pool"] = list(self.tcpudp_port_pool) |
|
1626 |
|
|
1627 |
if self.tcpudp_port_pool is None: |
|
1628 |
tcpudp_port_pool = [] |
|
1629 |
else: |
|
1630 |
tcpudp_port_pool = list(self.tcpudp_port_pool) |
|
1631 |
|
|
1632 |
mydict["tcpudp_port_pool"] = tcpudp_port_pool |
|
1633 |
|
|
1627 | 1634 |
return mydict |
1628 | 1635 |
|
1629 | 1636 |
@classmethod |
... | ... | |
1632 | 1639 |
|
1633 | 1640 |
""" |
1634 | 1641 |
obj = super(Cluster, cls).FromDict(val) |
1635 |
if not isinstance(obj.tcpudp_port_pool, set): |
|
1642 |
|
|
1643 |
if obj.tcpudp_port_pool is None: |
|
1644 |
obj.tcpudp_port_pool = set() |
|
1645 |
elif not isinstance(obj.tcpudp_port_pool, set): |
|
1636 | 1646 |
obj.tcpudp_port_pool = set(obj.tcpudp_port_pool) |
1647 |
|
|
1637 | 1648 |
return obj |
1638 | 1649 |
|
1639 | 1650 |
def SimpleFillDP(self, diskparams): |
Also available in: Unified diff