/snap/core24/1587/usr/lib/python3/dist-packages/cloudinit/distros
NameSizeModeActions
package_management/-0755rm
parsers/-0755rm
__pycache__/-0755rm
almalinux.py1510644editdlrm
alpine.py249320644editdlrm
amazon.py9070644editdlrm
aosc.py44820644editdlrm
arch.py50370644editdlrm
azurelinux.py24050644editdlrm
bsd.py64900644editdlrm
bsd_utils.py14400644editdlrm
centos.py1510644editdlrm
cloudlinux.py1510644editdlrm
cos.py2470644editdlrm
debian.py108570644editdlrm
dragonflybsd.py2300644editdlrm
eurolinux.py1510644editdlrm
fedora.py4370644editdlrm
freebsd.py87350644editdlrm
gentoo.py49900644editdlrm
mariner.py17400644editdlrm
miraclelinux.py1510644editdlrm
netbsd.py56470644editdlrm
networking.py110700644editdlrm
openbsd.py24230644editdlrm
OpenCloudOS.py2770644editdlrm
openeuler.py2750644editdlrm
openmandriva.py2370644editdlrm
opensuse-leap.py2470644editdlrm
opensuse-microos.py2470644editdlrm
opensuse-tumbleweed.py2470644editdlrm
opensuse.py102010644editdlrm
photon.py54860644editdlrm
raspberry_pi_os.py22570644editdlrm
rhel.py81720644editdlrm
rhel_util.py14300644editdlrm
rocky.py1510644editdlrm
sle-micro.py2470644editdlrm
sles.py2470644editdlrm
sle_hpc.py2470644editdlrm
suse.py810644editdlrm
TencentOS.py2770644editdlrm
ubuntu.py23740644editdlrm
ug_util.py100010644editdlrm
virtuozzo.py1510644editdlrm
__init__.py675420644editdlrm
Edit: /snap/core24/1587/usr/lib/python3/dist-packages/cloudinit/distros/openbsd.py (2423B)
# Copyright (C) 2019-2020 Gonéri Le Bouder # # This file is part of cloud-init. See LICENSE file for license information. import logging import cloudinit.distros.netbsd from cloudinit import subp, util LOG = logging.getLogger(__name__) class Distro(cloudinit.distros.netbsd.NetBSD): hostname_conf_fn = "/etc/myname" init_cmd = ["rcctl"] # For OpenBSD (from https://man.openbsd.org/passwd.5) a password field # of "" indicates no password, and password field values of either # "*" or "*************" (13 "*") indicate differing forms of "locked" # but with no password defined. shadow_empty_locked_passwd_patterns = [ r"^{username}::", r"^{username}:\*:", r"^{username}:\*\*\*\*\*\*\*\*\*\*\*\*\*:", ] def _read_hostname(self, filename, default=None): return util.load_text_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] @classmethod def manage_service(cls, action: str, service: str, *extra_args, rcs=None): """ Perform the requested action on a service. This handles OpenBSD's 'rcctl'. May raise ProcessExecutionError """ init_cmd = cls.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, rcs=rcs) 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): LOG.debug( "OpenBSD password lock is not reversible, " "ignoring unlock for user %s", name, ) def _get_pkg_cmd_environ(self): """Return env vars used in OpenBSD package_command operations""" return {}