OXIESEC PANEL
- Current Dir:
/
/
snap
/
core
/
17210
/
usr
/
lib
/
python3
/
dist-packages
/
cloudinit
/
net
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
__init__.py
38.7 KB
03/19/2021 02:37:22 PM
rw-r--r--
📁
__pycache__
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
bsd.py
6.29 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
cmdline.py
8.91 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
dhcp.py
15.41 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
eni.py
21.04 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
freebsd.py
2.15 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
netbsd.py
1.36 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
netplan.py
15.83 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
network_state.py
33.87 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
openbsd.py
1.51 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
renderer.py
1.87 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
renderers.py
1.53 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
sysconfig.py
39.85 KB
03/19/2021 02:37:22 PM
rw-r--r--
📄
udev.py
1.38 KB
03/19/2021 02:37:22 PM
rw-r--r--
Editing: openbsd.py
Close
# This file is part of cloud-init. See LICENSE file for license information. from cloudinit import log as logging from cloudinit import subp from cloudinit import util import cloudinit.net.bsd LOG = logging.getLogger(__name__) class Renderer(cloudinit.net.bsd.BSDRenderer): def write_config(self): for device_name, v in self.interface_configurations.items(): if_file = 'etc/hostname.{}'.format(device_name) fn = subp.target_path(self.target, if_file) if device_name in self.dhcp_interfaces(): content = 'dhcp\n' elif isinstance(v, dict): try: content = "inet {address} {netmask}\n".format( address=v['address'], netmask=v['netmask'] ) except KeyError: LOG.error( "Invalid static configuration for %s", device_name) util.write_file(fn, content) def start_services(self, run=False): if not self._postcmds: LOG.debug("openbsd generate postcmd disabled") return subp.subp(['sh', '/etc/netstart'], capture=True) def set_route(self, network, netmask, gateway): if network == '0.0.0.0': if_file = 'etc/mygate' fn = subp.target_path(self.target, if_file) content = gateway + '\n' util.write_file(fn, content) def available(target=None): return util.is_OpenBSD()