def get_default_name(self): itype = self.get_config_interface_type() name = _("No interface selected") if itype == Interface.Interface.INTERFACE_TYPE_BRIDGE: name = Interface.Interface.find_free_name(self.conn.vmm, "br") elif itype == Interface.Interface.INTERFACE_TYPE_BOND: name = Interface.Interface.find_free_name(self.conn.vmm, "bond") else: ifaces = self.get_config_selected_interfaces() if len(ifaces) > 0: iface = ifaces[0][INTERFACE_ROW_NAME] if itype == Interface.Interface.INTERFACE_TYPE_VLAN: tag = uihelpers.spin_get_helper(self.widget("vlan-tag")) name = "%s.%s" % (iface, int(tag)) elif itype == Interface.Interface.INTERFACE_TYPE_ETHERNET: name = iface return name
def validate_vlan(self, iobj, ifaces): idx = uihelpers.spin_get_helper(self.widget("vlan-tag")) iobj.tag = int(idx) return True