def getZonesLowestMacs(sharedZones, exclusiveZones, networking):
    interfaces = networking.getInterfaces()

    globalInterfaces = [interface for interface in interfaces if not interface._hasRole(solaris_networking.ZoneRole)]
    globalLowestMac = networkingModule.getLowestMac(globalInterfaces)
    if globalLowestMac:
        for sharedZone in sharedZones:
            sharedZone.lowestMac = globalLowestMac
    else:
        logger.warn("Failed to find lowest MAC address for shared zones")

    for exclusiveZone in exclusiveZones:
        zoneInterfaces = networking.getZoneInterfaces(exclusiveZone.name)
        zoneLowestMac = networkingModule.getLowestMac(zoneInterfaces)
        if zoneLowestMac:
            exclusiveZone.lowestMac = zoneLowestMac
        else:
            logger.warn("Failed to find lowest MAC for exclusive zone '%s'" % exclusiveZone.name)
Example #2
0
def _findHostKeyForControlDomain(networking):
    '''
    @types: solaris_networking.GlobalZoneNetworking -> string
    Method finds host key for control domain
    '''
    if networking is not None:
        interfaces = networking.getInterfaces()
        if interfaces:
            return networkingModule.getLowestMac(interfaces)
Example #3
0
def _findHostKeyForControlDomain(networking):
    '''
    @types: solaris_networking.GlobalZoneNetworking -> string
    Method finds host key for control domain
    '''
    if networking is not None:
        interfaces = networking.getInterfaces()
        if interfaces:
            return networkingModule.getLowestMac(interfaces)