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