コード例 #1
0
ファイル: linux_networking.py プロジェクト: deezeesms/dd-git
    def __createNetworking(self, interfacesInfo, aggregations, dhcpEnabledInterfacesList):
        '''
        @param interfaces: interface objects
        @param ipsInfo:
        '''
        unixNetworking = UnixNetworking()
        for interface, ips in interfacesInfo:
            unixNetworking.addInterface(interface)
            for ip in ips:
                dhcpEnabled = interface.name in dhcpEnabledInterfacesList
                unixNetworking.addIpAndNetwork(ip.ip, ip.netmask,
                                               interface.name, dhcpEnabled)

        if aggregations:
            for aggregation in aggregations:
                self.__setAggregationRole(unixNetworking, aggregation)

        if len(unixNetworking.getInterfaces()):
            return unixNetworking