Revision 48616625

b/doc/hooks.rst
286 286
INSTANCE_OS_TYPE, INSTANCE_DISK_TEMPLATE, INSTANCE_MEMORY,
287 287
INSTANCE_DISK_SIZES, INSTANCE_VCPUS, INSTANCE_NIC_COUNT,
288 288
INSTANCE_NICn_IP, INSTANCE_NICn_BRIDGE, INSTANCE_NICn_MAC,
289
INSTANCE_NICn_NETWORK, INSTANCE_NICn_NETWORK_FAMILY,
289
INSTANCE_NICn_NETWORK,
290 290
INSTANCE_NICn_NETWORK_UUID, INSTANCE_NICn_NETWORK_SUBNET,
291 291
INSTANCE_NICn_NETWORK_GATEWAY, INSTANCE_NICn_NETWORK_SUBNET6,
292 292
INSTANCE_NICn_NETWORK_GATEWAY6, INSTANCE_NICn_NETWORK_MAC_PREFIX,
b/lib/cmdlib.py
16242 16242
                           network6=self.op.network6,
16243 16243
                           gateway6=self.op.gateway6,
16244 16244
                           mac_prefix=self.op.mac_prefix,
16245
                           uuid=self.network_uuid,
16246
                           family=constants.IP4_VERSION)
16245
                           uuid=self.network_uuid)
16247 16246
    # Initialize the associated address pool
16248 16247
    try:
16249 16248
      pool = network.AddressPool.InitializeNetwork(nobj)
b/lib/network.py
123 123
    return (self.reservations | self.ext_reservations)
124 124

  
125 125
  def Validate(self):
126
    assert self.net.family == 4
127 126
    assert len(self.reservations) == self._GetSize()
128 127
    assert len(self.ext_reservations) == self._GetSize()
129 128
    all_res = self.reservations & self.ext_reservations
130 129
    assert not all_res.any()
131 130

  
132 131
    if self.gateway is not None:
133
      assert self.net.family == self.gateway.version
134 132
      assert self.gateway in self.network
135 133

  
136 134
    if self.network6 and self.gateway6:
b/lib/objects.py
2035 2035
    "name",
2036 2036
    "serial_no",
2037 2037
    "mac_prefix",
2038
    "family",
2039 2038
    "network",
2040 2039
    "network6",
2041 2040
    "gateway",
2042 2041
    "gateway6",
2043
    "size",
2044 2042
    "reservations",
2045 2043
    "ext_reservations",
2046 2044
    ] + _TIMESTAMPS + _UUID
......
2055 2053
    result = {
2056 2054
      "%sNETWORK" % prefix: self.name,
2057 2055
      "%sNETWORK_UUID" % prefix: self.uuid,
2058
      "%sNETWORK_FAMILY" % prefix: str(self.family),
2059 2056
      "%sNETWORK_TAGS" % prefix: " ".join(self.tags),
2060 2057
    }
2061 2058
    if self.network:
......
2075 2072
  def FromDict(cls, val):
2076 2073
    """Custom function for networks.
2077 2074

  
2078
    Remove deprecated network_type. Still this info can be passed via tags.
2075
    Remove deprecated network_type and family.
2079 2076

  
2080 2077
    """
2081 2078
    if "network_type" in val:
2082 2079
      del val["network_type"]
2080
    if "family" in val:
2081
      del val["family"]
2083 2082
    obj = super(Network, cls).FromDict(val)
2084 2083
    return obj
2085 2084

  
b/src/Ganeti/Objects.hs
174 174
  [ simpleField "name"             [t| NonEmptyString |]
175 175
  , optionalField $
176 176
    simpleField "mac_prefix"       [t| String |]
177
  , optionalField $
178
    simpleField "family"           [t| Int |]
179 177
  , simpleField "network"          [t| NonEmptyString |]
180 178
  , optionalField $
181 179
    simpleField "network6"         [t| String |]
......
184 182
  , optionalField $
185 183
    simpleField "gateway6"         [t| String |]
186 184
  , optionalField $
187
    simpleField "size"             [t| J.JSValue |]
188
  , optionalField $
189 185
    simpleField "reservations"     [t| String |]
190 186
  , optionalField $
191 187
    simpleField "ext_reservations" [t| String |]

Also available in: Unified diff