ACIL FM
Dark
Refresh
Current DIR:
/usr/lib/python3.9/site-packages/cloudinit/sources/helpers/vmware/imc
/
usr
lib
python3.9
site-packages
cloudinit
sources
helpers
vmware
imc
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
boot_proto.py
308 B
chmod
View
DL
Edit
Rename
Delete
config.py
4.42 MB
chmod
View
DL
Edit
Rename
Delete
config_custom_script.py
3.03 MB
chmod
View
DL
Edit
Rename
Delete
config_file.py
2.15 MB
chmod
View
DL
Edit
Rename
Delete
config_nic.py
8.27 MB
chmod
View
DL
Edit
Rename
Delete
config_passwd.py
2.37 MB
chmod
View
DL
Edit
Rename
Delete
config_source.py
276 B
chmod
View
DL
Edit
Rename
Delete
guestcust_error.py
411 B
chmod
View
DL
Edit
Rename
Delete
guestcust_event.py
461 B
chmod
View
DL
Edit
Rename
Delete
guestcust_state.py
358 B
chmod
View
DL
Edit
Rename
Delete
guestcust_util.py
19.99 MB
chmod
View
DL
Edit
Rename
Delete
nic.py
3.21 MB
chmod
View
DL
Edit
Rename
Delete
nic_base.py
3.78 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
0 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/lib/python3.9/site-packages/cloudinit/sources/helpers/vmware/imc/config_file.py
# Copyright (C) 2015 Canonical Ltd. # Copyright (C) 2015 VMware Inc. # # Author: Sankar Tanguturi <stanguturi@vmware.com> # # This file is part of cloud-init. See LICENSE file for license information. import configparser import logging from cloudinit.sources.helpers.vmware.imc.config_source import ConfigSource logger = logging.getLogger(__name__) class ConfigFile(ConfigSource, dict): """ConfigFile module to load the content from a specified source.""" def __init__(self, filename): self._loadConfigFile(filename) def _insertKey(self, key, val): """ Inserts a Key Value pair. Keyword arguments: key -- The key to insert val -- The value to insert for the key """ key = key.strip() val = val.strip() if key.startswith("-") or "|-" in key: canLog = False else: canLog = True # "sensitive" settings shall not be logged if canLog: logger.debug("ADDED KEY-VAL :: '%s' = '%s'", key, val) else: logger.debug("ADDED KEY-VAL :: '%s' = '*****************'", key) self[key] = val def _loadConfigFile(self, filename): """ Parses properties from the specified config file. Any previously available properties will be removed. Sensitive data will not be logged in case the key starts from '-'. Keyword arguments: filename - The full path to the config file. """ logger.info("Parsing the config file %s.", filename) config = configparser.ConfigParser() config.optionxform = str config.read(filename) self.clear() for category in config.sections(): logger.debug("FOUND CATEGORY = '%s'", category) for key, value in config.items(category): self._insertKey(category + "|" + key, value) def get_count_with_prefix(self, prefix): """ Return the total count of keys that start with the specified prefix. Keyword arguments: prefix -- prefix of the key """ return len([key for key in self if key.startswith(prefix)])
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply