����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.83 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/ |
Upload File : |
# 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)])