Remove family and size from network objects
authorDimitris Aragiorgis <dimara@grnet.gr>
Mon, 11 Feb 2013 12:42:36 +0000 (14:42 +0200)
committerGuido Trotter <ultrotter@google.com>
Mon, 11 Feb 2013 15:31:13 +0000 (16:31 +0100)
This info is not used by Ganeti and therefore is removed.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

doc/hooks.rst
lib/cmdlib.py
lib/network.py
lib/objects.py
src/Ganeti/Objects.hs

index 3f27953..5ccf935 100644 (file)
@@ -286,7 +286,7 @@ INSTANCE_NAME, INSTANCE_PRIMARY, INSTANCE_SECONDARY,
 INSTANCE_OS_TYPE, INSTANCE_DISK_TEMPLATE, INSTANCE_MEMORY,
 INSTANCE_DISK_SIZES, INSTANCE_VCPUS, INSTANCE_NIC_COUNT,
 INSTANCE_NICn_IP, INSTANCE_NICn_BRIDGE, INSTANCE_NICn_MAC,
-INSTANCE_NICn_NETWORK, INSTANCE_NICn_NETWORK_FAMILY,
+INSTANCE_NICn_NETWORK,
 INSTANCE_NICn_NETWORK_UUID, INSTANCE_NICn_NETWORK_SUBNET,
 INSTANCE_NICn_NETWORK_GATEWAY, INSTANCE_NICn_NETWORK_SUBNET6,
 INSTANCE_NICn_NETWORK_GATEWAY6, INSTANCE_NICn_NETWORK_MAC_PREFIX,
index 870402c..3704ec7 100644 (file)
@@ -16242,8 +16242,7 @@ class LUNetworkAdd(LogicalUnit):
                            network6=self.op.network6,
                            gateway6=self.op.gateway6,
                            mac_prefix=self.op.mac_prefix,
-                           uuid=self.network_uuid,
-                           family=constants.IP4_VERSION)
+                           uuid=self.network_uuid)
     # Initialize the associated address pool
     try:
       pool = network.AddressPool.InitializeNetwork(nobj)
index cc3bfd6..a1c51c5 100644 (file)
@@ -123,14 +123,12 @@ class AddressPool(object):
     return (self.reservations | self.ext_reservations)
 
   def Validate(self):
-    assert self.net.family == 4
     assert len(self.reservations) == self._GetSize()
     assert len(self.ext_reservations) == self._GetSize()
     all_res = self.reservations & self.ext_reservations
     assert not all_res.any()
 
     if self.gateway is not None:
-      assert self.net.family == self.gateway.version
       assert self.gateway in self.network
 
     if self.network6 and self.gateway6:
index bd4326c..de466c4 100644 (file)
@@ -2035,12 +2035,10 @@ class Network(TaggableObject):
     "name",
     "serial_no",
     "mac_prefix",
-    "family",
     "network",
     "network6",
     "gateway",
     "gateway6",
-    "size",
     "reservations",
     "ext_reservations",
     ] + _TIMESTAMPS + _UUID
@@ -2055,7 +2053,6 @@ class Network(TaggableObject):
     result = {
       "%sNETWORK" % prefix: self.name,
       "%sNETWORK_UUID" % prefix: self.uuid,
-      "%sNETWORK_FAMILY" % prefix: str(self.family),
       "%sNETWORK_TAGS" % prefix: " ".join(self.tags),
     }
     if self.network:
@@ -2075,11 +2072,13 @@ class Network(TaggableObject):
   def FromDict(cls, val):
     """Custom function for networks.
 
-    Remove deprecated network_type. Still this info can be passed via tags.
+    Remove deprecated network_type and family.
 
     """
     if "network_type" in val:
       del val["network_type"]
+    if "family" in val:
+      del val["family"]
     obj = super(Network, cls).FromDict(val)
     return obj
 
index d3f13df..51d166a 100644 (file)
@@ -174,8 +174,6 @@ $(buildObject "Network" "network" $
   [ simpleField "name"             [t| NonEmptyString |]
   , optionalField $
     simpleField "mac_prefix"       [t| String |]
-  , optionalField $
-    simpleField "family"           [t| Int |]
   , simpleField "network"          [t| NonEmptyString |]
   , optionalField $
     simpleField "network6"         [t| String |]
@@ -184,8 +182,6 @@ $(buildObject "Network" "network" $
   , optionalField $
     simpleField "gateway6"         [t| String |]
   , optionalField $
-    simpleField "size"             [t| J.JSValue |]
-  , optionalField $
     simpleField "reservations"     [t| String |]
   , optionalField $
     simpleField "ext_reservations" [t| String |]