Blame libnmstate/nispor/vrf.py
|
Packit Service |
293802 |
#
|
|
Packit Service |
293802 |
# Copyright (c) 2020 Red Hat, Inc.
|
|
Packit Service |
293802 |
#
|
|
Packit Service |
293802 |
# This file is part of nmstate
|
|
Packit Service |
293802 |
#
|
|
Packit Service |
293802 |
# This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
293802 |
# it under the terms of the GNU Lesser General Public License as published by
|
|
Packit Service |
293802 |
# the Free Software Foundation, either version 2.1 of the License, or
|
|
Packit Service |
293802 |
# (at your option) any later version.
|
|
Packit Service |
293802 |
#
|
|
Packit Service |
293802 |
# This program is distributed in the hope that it will be useful,
|
|
Packit Service |
293802 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
293802 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
293802 |
# GNU Lesser General Public License for more details.
|
|
Packit Service |
293802 |
#
|
|
Packit Service |
293802 |
# You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
293802 |
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
Packit Service |
293802 |
#
|
|
Packit Service |
293802 |
|
|
Packit Service |
293802 |
from libnmstate.schema import InterfaceType
|
|
Packit Service |
293802 |
from libnmstate.schema import VRF
|
|
Packit Service |
293802 |
|
|
Packit Service |
293802 |
from .base_iface import NisporPluginBaseIface
|
|
Packit Service |
293802 |
|
|
Packit Service |
293802 |
|
|
Packit Service |
293802 |
class NisporPluginVrfIface(NisporPluginBaseIface):
|
|
Packit Service |
293802 |
@property
|
|
Packit Service |
293802 |
def type(self):
|
|
Packit Service |
293802 |
return InterfaceType.VRF
|
|
Packit Service |
293802 |
|
|
Packit Service |
5e62f7 |
def to_dict(self, config_only):
|
|
Packit Service |
5e62f7 |
info = super().to_dict(config_only)
|
|
Packit Service |
293802 |
info[VRF.CONFIG_SUBTREE] = {
|
|
Packit Service |
293802 |
VRF.PORT_SUBTREE: self._np_iface.subordinates,
|
|
Packit Service |
293802 |
VRF.ROUTE_TABLE_ID: self._np_iface.table_id,
|
|
Packit Service |
293802 |
}
|
|
Packit Service |
293802 |
return info
|