Skip to content

Commit

Permalink
Default ip_family is set to None instead of ipv4
Browse files Browse the repository at this point in the history
Change-Id: I5638fafa75f6930016185a50ad77b24a1bc4645f
Closes-Bug: 1604923
  • Loading branch information
sahilsabharwal committed Nov 9, 2016
1 parent ab2c695 commit 1186806
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/config/api-server/vnc_cfg_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,13 @@ def pre_dbe_create(cls, tenant_name, obj_dict, db_conn):
if req_ip is None and subnet_uuid:
# pickup the version from subnet
req_ip_version = IPNetwork(sub).version
elif req_ip_family == "v4":
req_ip_version = 4
elif req_ip_family == "v6":
req_ip_version = 6
else:
req_ip_version = 4 # default ip v4
req_ip_version = None

if req_ip_family == "v6": req_ip_version = 6

# if request has ip and not g/w ip, report if already in use.
# for g/w ip, creation allowed but only can ref to router port.
Expand Down
4 changes: 2 additions & 2 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3559,7 +3559,7 @@ def _ip_addr_in_net_id(self, ip_addr, net_id):
return ip_addr in net_ip_list

def _create_instance_ip(self, net_obj, port_obj, ip_addr=None,
subnet_uuid=None, ip_family="v4"):
subnet_uuid=None, ip_family=None):
ip_name = str(uuid.uuid4())
ip_obj = InstanceIp(name=ip_name)
ip_obj.uuid = ip_name
Expand All @@ -3578,7 +3578,7 @@ def _create_instance_ip(self, net_obj, port_obj, ip_addr=None,
return ip_id
# end _create_instance_ip

def _port_create_instance_ip(self, net_obj, port_obj, port_q, ip_family="v4"):
def _port_create_instance_ip(self, net_obj, port_obj, port_q, ip_family=None):
fixed_ips = port_q.get('fixed_ips')
if fixed_ips is None:
return
Expand Down

0 comments on commit 1186806

Please sign in to comment.