/snap/core18/2979/usr/lib/python3/dist-packages/cloudinit/distros
NameSizeModeActions
parsers/-0755rm
__pycache__/-0755rm
almalinux.py1740644editdlrm
alpine.py68880644editdlrm
amazon.py6150644editdlrm
arch.py85370644editdlrm
bsd.py50290644editdlrm
bsd_utils.py14530644editdlrm
centos.py1740644editdlrm
cloudlinux.py1740644editdlrm
cos.py2700644editdlrm
debian.py136800644editdlrm
dragonflybsd.py2530644editdlrm
eurolinux.py1740644editdlrm
fedora.py4600644editdlrm
freebsd.py65900644editdlrm
gentoo.py91620644editdlrm
mariner.py17590644editdlrm
miraclelinux.py1740644editdlrm
netbsd.py45390644editdlrm
networking.py113500644editdlrm
net_util.py65730644editdlrm
openbsd.py19080644editdlrm
OpenCloudOS.py2770644editdlrm
openEuler.py2980644editdlrm
openmandriva.py2600644editdlrm
opensuse-leap.py2700644editdlrm
opensuse-microos.py2700644editdlrm
opensuse-tumbleweed.py2700644editdlrm
opensuse.py95810644editdlrm
photon.py48490644editdlrm
rhel.py72840644editdlrm
rhel_util.py14730644editdlrm
rocky.py1740644editdlrm
sle-micro.py2700644editdlrm
sles.py2700644editdlrm
sle_hpc.py2700644editdlrm
TencentOS.py2770644editdlrm
ubuntu.py15330644editdlrm
ug_util.py100320644editdlrm
virtuozzo.py1740644editdlrm
__init__.py438680644editdlrm
Edit: /snap/core18/2979/usr/lib/python3/dist-packages/cloudinit/distros/openbsd.py (1908B)
# Copyright (C) 2019-2020 Gonéri Le Bouder # # This file is part of cloud-init. See LICENSE file for license information. import os import cloudinit.distros.netbsd from cloudinit import log as logging from cloudinit import subp, util LOG = logging.getLogger(__name__) class Distro(cloudinit.distros.netbsd.NetBSD): hostname_conf_fn = "/etc/myname" init_cmd = ["rcctl"] def _read_hostname(self, filename, default=None): return util.load_file(self.hostname_conf_fn) def _write_hostname(self, hostname, filename): content = hostname + "\n" util.write_file(self.hostname_conf_fn, content) def _get_add_member_to_group_cmd(self, member_name, group_name): return ["usermod", "-G", group_name, member_name] def manage_service(self, action: str, service: str): """ Perform the requested action on a service. This handles OpenBSD's 'rcctl'. May raise ProcessExecutionError """ init_cmd = self.init_cmd cmds = { "stop": ["stop", service], "start": ["start", service], "enable": ["enable", service], "disable": ["disable", service], "restart": ["restart", service], "reload": ["restart", service], "try-reload": ["restart", service], "status": ["check", service], } cmd = list(init_cmd) + list(cmds[action]) return subp.subp(cmd, capture=True) def lock_passwd(self, name): try: subp.subp(["usermod", "-p", "*", name]) except Exception: util.logexc(LOG, "Failed to lock user %s", name) raise def unlock_passwd(self, name): pass def _get_pkg_cmd_environ(self): """Return env vars used in OpenBSD package_command operations""" e = os.environ.copy() return e # vi: ts=4 expandtab