Merge "objects: update fields_no_update to reflect models"
This commit is contained in:
@@ -35,3 +35,5 @@ class AutoAllocatedTopology(base.NeutronDbObject):
|
|||||||
'network_id': common_types.UUIDField(),
|
'network_id': common_types.UUIDField(),
|
||||||
'router_id': common_types.UUIDField(nullable=True),
|
'router_id': common_types.UUIDField(nullable=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = ['network_id', 'router_id']
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class IpamAllocationPool(base.NeutronDbObject):
|
|||||||
'last_ip': obj_fields.IPAddressField(),
|
'last_ip': obj_fields.IPAddressField(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = ['ipam_subnet_id']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def modify_fields_from_db(cls, db_obj):
|
def modify_fields_from_db(cls, db_obj):
|
||||||
result = super(IpamAllocationPool, cls).modify_fields_from_db(db_obj)
|
result = super(IpamAllocationPool, cls).modify_fields_from_db(db_obj)
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class MeteringLabelRule(base.NeutronDbObject):
|
|||||||
'excluded': obj_fields.BooleanField(default=False),
|
'excluded': obj_fields.BooleanField(default=False),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = ['metering_label_id']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def modify_fields_from_db(cls, db_obj):
|
def modify_fields_from_db(cls, db_obj):
|
||||||
result = super(MeteringLabelRule, cls).modify_fields_from_db(db_obj)
|
result = super(MeteringLabelRule, cls).modify_fields_from_db(db_obj)
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ class NetworkSegment(base.NeutronDbObject):
|
|||||||
|
|
||||||
synthetic_fields = ['hosts']
|
synthetic_fields = ['hosts']
|
||||||
|
|
||||||
|
fields_no_update = ['network_id']
|
||||||
|
|
||||||
foreign_keys = {
|
foreign_keys = {
|
||||||
'Network': {'network_id': 'id'},
|
'Network': {'network_id': 'id'},
|
||||||
'PortBindingLevel': {'id': 'segment_id'},
|
'PortBindingLevel': {'id': 'segment_id'},
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ class ExtraDhcpOpt(base.NeutronDbObject):
|
|||||||
'ip_version': obj_fields.IntegerField(),
|
'ip_version': obj_fields.IntegerField(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = ['port_id']
|
||||||
|
|
||||||
foreign_keys = {
|
foreign_keys = {
|
||||||
'Port': {'port_id': 'id'},
|
'Port': {'port_id': 'id'},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ class IPAllocation(base.NeutronDbObject):
|
|||||||
'ip_address': obj_fields.IPAddressField(),
|
'ip_address': obj_fields.IPAddressField(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = fields.keys()
|
||||||
|
|
||||||
primary_keys = ['subnet_id', 'network_id', 'ip_address']
|
primary_keys = ['subnet_id', 'network_id', 'ip_address']
|
||||||
|
|
||||||
foreign_keys = {
|
foreign_keys = {
|
||||||
@@ -261,6 +263,8 @@ class Port(base.NeutronDbObject):
|
|||||||
# field in later object iterations
|
# field in later object iterations
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = ['project_id', 'network_id']
|
||||||
|
|
||||||
synthetic_fields = [
|
synthetic_fields = [
|
||||||
'allowed_address_pairs',
|
'allowed_address_pairs',
|
||||||
'binding',
|
'binding',
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class SecurityGroupRule(base.NeutronDbObject):
|
|||||||
|
|
||||||
foreign_keys = {'SecurityGroup': {'security_group_id': 'id'}}
|
foreign_keys = {'SecurityGroup': {'security_group_id': 'id'}}
|
||||||
|
|
||||||
fields_no_update = ['project_id', 'security_group_id']
|
fields_no_update = ['project_id', 'security_group_id', 'remote_group_id']
|
||||||
|
|
||||||
# TODO(sayalilunkad): get rid of it once we switch the db model to using
|
# TODO(sayalilunkad): get rid of it once we switch the db model to using
|
||||||
# custom types.
|
# custom types.
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ class IPAllocationPool(base.NeutronDbObject):
|
|||||||
'end': obj_fields.IPAddressField()
|
'end': obj_fields.IPAddressField()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fields_no_update = ['subnet_id']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def modify_fields_from_db(cls, db_obj):
|
def modify_fields_from_db(cls, db_obj):
|
||||||
# TODO(korzen) remove this method when IP and CIDR decorator ready
|
# TODO(korzen) remove this method when IP and CIDR decorator ready
|
||||||
@@ -195,7 +197,7 @@ class Subnet(base.NeutronDbObject):
|
|||||||
|
|
||||||
foreign_keys = {'Network': {'network_id': 'id'}}
|
foreign_keys = {'Network': {'network_id': 'id'}}
|
||||||
|
|
||||||
fields_no_update = ['project_id']
|
fields_no_update = ['project_id', 'network_id', 'segment_id']
|
||||||
|
|
||||||
fields_need_translation = {
|
fields_need_translation = {
|
||||||
'host_routes': 'routes'
|
'host_routes': 'routes'
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class SubPort(base.NeutronDbObject):
|
|||||||
'segmentation_id': obj_fields.IntegerField(),
|
'segmentation_id': obj_fields.IntegerField(),
|
||||||
}
|
}
|
||||||
|
|
||||||
fields_no_update = ['segmentation_type', 'segmentation_id']
|
fields_no_update = ['segmentation_type', 'segmentation_id', 'trunk_id']
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
_dict = super(SubPort, self).to_dict()
|
_dict = super(SubPort, self).to_dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user