contrail-charms: support interface name as control-network parameter

Bug #1778242 reported by Bernhard Koessler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
High
Andrey Pavlov

Bug Description

currently, the contrail-charms for contrail-controller, contrail-analytics and contrail-analyticsdb expect a CIDR as input to the control-network paramter. This is impractical in deployments where dynamic subnets per rack are deployed which are not known at the time of bundle generation. In those cases it would be better to be able to define an interface name in line with vrouter interface configuration in contrail-agent charm.

My hack I used to achieve this is as follows:

contrail-[controller|analytics|analyticsdb]/hooks/common_utils.py:

def get_ip():
    network = config.get("control-network")
    ip = None
    try:
      ip = get_address_in_network(network) if network else None
    except ValueError:
      log("control-network not defined as CIDR")
    if not ip:
      # if no CIDR format is provided, treat as interface name
      ip = get_iface_addr(iface=network)[0] if network else None
    if not ip:
        ip = _get_default_ip()
    return ip

Changed in juniperopenstack:
assignee: nobody → Andrey Pavlov (apavlov-e)
Changed in juniperopenstack:
milestone: none → r4.1.2.0
status: New → Fix Committed
Jeba Paulaiyan (jebap)
no longer affects: juniperopenstack/r5.0
no longer affects: juniperopenstack/r4.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.