network: document and add type hint for NetworkDev.info

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
Olivier Gayot 2023-09-06 14:42:53 +02:00
parent dc26a1d252
commit 221466aa70
1 changed files with 6 additions and 2 deletions

View File

@ -21,6 +21,7 @@ from socket import AF_INET, AF_INET6
from typing import Dict, List, Optional
import attr
import probert.network
import yaml
from subiquitycore import netplan
@ -189,13 +190,16 @@ class BondParameters:
]
class NetworkDev(object):
class NetworkDev:
def __init__(self, model, name, typ):
self._model = model
self._name = name
self.type = typ
self.config = {}
self.info = None
# Devices that have been configured in Subiquity but do not (yet) exist
# on the system have their "info" field set to None. Once they exist,
# probert should pass on the information through a call to new_link().
self.info: Optional[probert.network.Link] = None
self.disabled_reason = None
self.dhcp_events = {}
self._dhcp_state = {