/snap/core22/2437/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/core22/2437/usr/lib/python3/dist-packages/cloudinit/distros/rhel_util.py (1430B)
# Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # Copyright (C) 2012 Yahoo! Inc. # # Author: Scott Moser # Author: Juerg Haefliger # Author: Joshua Harlow # # This file is part of cloud-init. See LICENSE file for license information. import logging from cloudinit import util from cloudinit.distros.parsers.sys_conf import SysConf LOG = logging.getLogger(__name__) # Helper function to update a RHEL/SUSE /etc/sysconfig/* file def update_sysconfig_file(fn, adjustments, allow_empty=False): if not adjustments: return (exists, contents) = read_sysconfig_file(fn) updated_am = 0 for k, v in adjustments.items(): if v is None: continue v = str(v) if (not v) and (not allow_empty): continue contents[k] = v updated_am += 1 if updated_am: lines = [ str(contents), ] if not exists: lines.insert(0, util.make_header()) util.write_file(fn, "\n".join(lines) + "\n", 0o644) # Helper function to read a RHEL/SUSE /etc/sysconfig/* file def read_sysconfig_file(fn): exists = False try: contents = util.load_text_file(fn).splitlines() exists = True except IOError: contents = [] return (exists, SysConf(contents))