Search is not available for this dataset
text
stringlengths
75
104k
def _plaintext_data_key(): ''' Return the configured KMS data key decrypted and encoded in urlsafe base64. Cache the result to minimize API calls to AWS. ''' response = getattr(_plaintext_data_key, 'response', None) cache_hit = response is not None if not cache_hit: response = _api_...
def _decrypt_ciphertext(cipher, translate_newlines=False): ''' Given a blob of ciphertext as a bytestring, try to decrypt the cipher and return the decrypted string. If the cipher cannot be decrypted, log the error, and return the ciphertext back out. ''' if translate_newlines: cipher = ...
def _decrypt_object(obj, translate_newlines=False): ''' Recursively try to decrypt any object. Recur on objects that are not strings. Decrypt strings that are valid Fernet tokens. Return the rest unchanged. ''' if salt.utils.stringio.is_readable(obj): return _decrypt_object(obj.getva...
def render(data, saltenv='base', sls='', argline='', **kwargs): # pylint: disable=unused-argument ''' Decrypt the data to be rendered that was encrypted using AWS KMS envelope encryption. ''' translate_newlines = kwargs.get('translate_newlines', False) return _decrypt_object(data, translate_newline...
def _serial_sanitizer(instr): '''Replaces the last 1/4 of a string with X's''' length = len(instr) index = int(math.floor(length * .75)) return '{0}{1}'.format(instr[:index], 'X' * (length - index))
def get(key, default='', delimiter=DEFAULT_TARGET_DELIM, ordered=True): ''' Attempt to retrieve the named value from grains, if the named value is not available return the passed default. The default return is an empty string. The value can also represent a value in a nested dict using a ":" delimiter ...
def has_value(key): ''' Determine whether a key exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: .. code-...
def items(sanitize=False): ''' Return all of the minion's grains CLI Example: .. code-block:: bash salt '*' grains.items Sanitized CLI Example: .. code-block:: bash salt '*' grains.items sanitize=True ''' if salt.utils.data.is_true(sanitize): out = dict(__gr...
def item(*args, **kwargs): ''' Return one or more grains CLI Example: .. code-block:: bash salt '*' grains.item os salt '*' grains.item os osrelease oscodename Sanitized CLI Example: .. code-block:: bash salt '*' grains.item host sanitize=True ''' ret = {} ...
def setvals(grains, destructive=False): ''' Set new grains values in the grains config file destructive If an operation results in a key being removed, delete the key, too. Defaults to False. CLI Example: .. code-block:: bash salt '*' grains.setvals "{'key1': 'val1', 'key...
def append(key, val, convert=False, delimiter=DEFAULT_TARGET_DELIM): ''' .. versionadded:: 0.17.0 Append a value to a list in the grains config file. If the grain doesn't exist, the grain key is added and the value is appended to the new grain as a list item. key The grain key to be ap...
def remove(key, val, delimiter=DEFAULT_TARGET_DELIM): ''' .. versionadded:: 0.17.0 Remove a value from a list in the grains config file key The grain key to remove. val The value to remove. delimiter The key can be a nested dict key. Use this parameter to spec...
def filter_by(lookup_dict, grain='os_family', merge=None, default='default', base=None): ''' .. versionadded:: 0.17.0 Look up the given grain in a given dictionary for the current OS and return the result Although this may occasionally be useful at the CLI, the primary intent of this function ...
def _dict_from_path(path, val, delimiter=DEFAULT_TARGET_DELIM): ''' Given a lookup string in the form of 'foo:bar:baz" return a nested dictionary of the appropriate depth with the final segment as a value. >>> _dict_from_path('foo:bar:baz', 'somevalue') {"foo": {"bar": {"baz": "somevalue"}} '''...
def get_or_set_hash(name, length=8, chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'): ''' Perform a one-time generation of a hash and write it to the local grains. If that grain has already been set return the value instead. This is useful for generating passwords or keys tha...
def set(key, val='', force=False, destructive=False, delimiter=DEFAULT_TARGET_DELIM): ''' Set a key to an arbitrary value. It is used like setval but works with nested keys. This function is conservative. It will only overwrite an entry if its value and the given one...
def equals(key, value): ''' Used to make sure the minion's grain key/value matches. Returns ``True`` if matches otherwise ``False``. .. versionadded:: 2017.7.0 CLI Example: .. code-block:: bash salt '*' grains.equals fqdn <expected_fqdn> salt '*' grains.equals systemd:versio...
def _get_xapi_session(): ''' Get a session to XenAPI. By default, use the local UNIX socket. ''' _xenapi = _check_xenapi() xapi_uri = __salt__['config.option']('xapi.uri') xapi_login = __salt__['config.option']('xapi.login') xapi_password = __salt__['config.option']('xapi.password') if...
def _get_xtool(): ''' Internal, returns xl or xm command line path ''' for xtool in ['xl', 'xm']: path = salt.utils.path.which(xtool) if path is not None: return path
def _get_label_uuid(xapi, rectype, label): ''' Internal, returns label's uuid ''' try: return getattr(xapi, rectype).get_by_name_label(label)[0] except Exception: return False
def _get_record_by_label(xapi, rectype, label): ''' Internal, returns a full record for uuid ''' uuid = _get_label_uuid(xapi, rectype, label) if uuid is False: return False return getattr(xapi, rectype).get_record(uuid)
def _get_metrics_record(xapi, rectype, record): ''' Internal, returns metrics record for a rectype ''' metrics_id = record['metrics'] return getattr(xapi, '{0}_metrics'.format(rectype)).get_record(metrics_id)
def _get_val(record, keys): ''' Internal, get value from record ''' data = record for key in keys: if key in data: data = data[key] else: return None return data
def list_domains(): ''' Return a list of virtual machine names on the minion CLI Example: .. code-block:: bash salt '*' virt.list_domains ''' with _get_xapi_session() as xapi: hosts = xapi.VM.get_all() ret = [] for _host in hosts: if xapi.VM.get_re...
def vm_info(vm_=None): ''' Return detailed information about the vms. If you pass a VM name in as an argument then it will return info for just the named VM, otherwise it will return all VMs. CLI Example: .. code-block:: bash salt '*' virt.vm_info ''' with _get_xapi_session()...
def vm_state(vm_=None): ''' Return list of all the vms and their state. If you pass a VM name in as an argument then it will return info for just the named VM, otherwise it will return all VMs. CLI Example: .. code-block:: bash salt '*' virt.vm_state <vm name> ''' with _get_x...
def node_info(): ''' Return a dict with information about this node CLI Example: .. code-block:: bash salt '*' virt.node_info ''' with _get_xapi_session() as xapi: # get node uuid host_rec = _get_record(xapi, 'host', _get_all(xapi, 'host')[0]) # get first CPU (...
def get_nics(vm_): ''' Return info about the network interfaces of a named vm CLI Example: .. code-block:: bash salt '*' virt.get_nics <vm name> ''' with _get_xapi_session() as xapi: nic = {} vm_rec = _get_record_by_label(xapi, 'VM', vm_) if vm_rec is False: ...
def get_macs(vm_): ''' Return a list off MAC addresses from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_macs <vm name> ''' macs = [] nics = get_nics(vm_) if nics is None: return None for nic in nics: macs.append(nic) return macs
def get_disks(vm_): ''' Return the disks of a named vm CLI Example: .. code-block:: bash salt '*' virt.get_disks <vm name> ''' with _get_xapi_session() as xapi: disk = {} vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: return False...
def setmem(vm_, memory): ''' Changes the amount of memory allocated to VM. Memory is to be specified in MB CLI Example: .. code-block:: bash salt '*' virt.setmem myvm 768 ''' with _get_xapi_session() as xapi: mem_target = int(memory) * 1024 * 1024 vm_uuid = _get_...
def setvcpus(vm_, vcpus): ''' Changes the amount of vcpus allocated to VM. vcpus is an int representing the number to be assigned CLI Example: .. code-block:: bash salt '*' virt.setvcpus myvm 2 ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm...
def vcpu_pin(vm_, vcpu, cpus): ''' Set which CPUs a VCPU can use. CLI Example: .. code-block:: bash salt 'foo' virt.vcpu_pin domU-id 2 1 salt 'foo' virt.vcpu_pin domU-id 2 2-6 ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if ...
def shutdown(vm_): ''' Send a soft shutdown signal to the named vm CLI Example: .. code-block:: bash salt '*' virt.shutdown <vm name> ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: return False ...
def pause(vm_): ''' Pause the named vm CLI Example: .. code-block:: bash salt '*' virt.pause <vm name> ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: return False try: xapi.VM.pause(...
def resume(vm_): ''' Resume the named vm CLI Example: .. code-block:: bash salt '*' virt.resume <vm name> ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: return False try: xapi.VM.unp...
def reboot(vm_): ''' Reboot a domain via ACPI request CLI Example: .. code-block:: bash salt '*' virt.reboot <vm name> ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: return False try: ...
def reset(vm_): ''' Reset a VM by emulating the reset button on a physical machine CLI Example: .. code-block:: bash salt '*' virt.reset <vm name> ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: return F...
def migrate(vm_, target, live=1, port=0, node=-1, ssl=None, change_home_server=0): ''' Migrates the virtual machine to another hypervisor CLI Example: .. code-block:: bash salt '*' virt.migrate <vm name> <target hypervisor> [live] [port] [node] [ssl] [change_home_server] Opti...
def stop(vm_): ''' Hard power down the virtual machine, this is equivalent to pulling the power CLI Example: .. code-block:: bash salt '*' virt.stop <vm name> ''' with _get_xapi_session() as xapi: vm_uuid = _get_label_uuid(xapi, 'VM', vm_) if vm_uuid is False: ...
def is_hyper(): ''' Returns a bool whether or not this node is a hypervisor of any kind CLI Example: .. code-block:: bash salt '*' virt.is_hyper ''' try: if __grains__['virtual_subtype'] != 'Xen Dom0': return False except KeyError: # virtual_subtype isn...
def vm_cputime(vm_=None): ''' Return cputime used by the vms on this hyper in a list of dicts: .. code-block:: python [ 'your-vm': { 'cputime' <int> 'cputime_percent' <int> }, ... ] If you pass a VM name i...
def vm_netstats(vm_=None): ''' Return combined network counters used by the vms on this hyper in a list of dicts: .. code-block:: python [ 'your-vm': { 'io_read_kbs' : 0, 'io_total_read_kbs' : 0, 'io_total_write_kbs' ...
def vm_diskstats(vm_=None): ''' Return disk usage counters used by the vms on this hyper in a list of dicts: .. code-block:: python [ 'your-vm': { 'io_read_kbs' : 0, 'io_write_kbs' : 0 }, ... ] If you p...
def _clean_message(message): '''Internal helper to sanitize message output''' message = message.replace('zonecfg: ', '') message = message.splitlines() for line in message: if line.startswith('On line'): message.remove(line) return "\n".join(message)
def _parse_value(value): '''Internal helper for parsing configuration values into python values''' if isinstance(value, bool): return 'true' if value else 'false' elif isinstance(value, six.string_types): # parse compacted notation to dict listparser = re.compile(r'''((?:[^,"']|"[^"]...
def _sanitize_value(value): '''Internal helper for converting pythonic values to configuration file values''' # dump dict into compated if isinstance(value, dict): new_value = [] new_value.append('(') for k, v in value.items(): new_value.append(k) new_value.ap...
def _dump_cfg(cfg_file): '''Internal helper for debugging cfg files''' if __salt__['file.file_exists'](cfg_file): with salt.utils.files.fopen(cfg_file, 'r') as fp_: log.debug( "zonecfg - configuration file:\n%s", "".join(salt.utils.data.decode(fp_.readline...
def create(zone, brand, zonepath, force=False): ''' Create an in-memory configuration for the specified zone. zone : string name of zone brand : string brand name zonepath : string path of zone force : boolean overwrite configuration CLI Example: .. cod...
def create_from_template(zone, template): ''' Create an in-memory configuration from a template for the specified zone. zone : string name of zone template : string name of template .. warning:: existing config will be overwritten! CLI Example: .. code-block:: bas...
def delete(zone): ''' Delete the specified configuration from memory and stable storage. zone : string name of zone CLI Example: .. code-block:: bash salt '*' zonecfg.delete epyon ''' ret = {'status': True} # delete zone res = __salt__['cmd.run_all']('zonecfg -z ...
def export(zone, path=None): ''' Export the configuration from memory to stable storage. zone : string name of zone path : string path of file to export to CLI Example: .. code-block:: bash salt '*' zonecfg.export epyon salt '*' zonecfg.export epyon /zones/epy...
def import_(zone, path): ''' Import the configuration to memory from stable storage. zone : string name of zone path : string path of file to export to CLI Example: .. code-block:: bash salt '*' zonecfg.import epyon /zones/epyon.cfg ''' ret = {'status': True} ...
def _property(methode, zone, key, value): ''' internal handler for set and clear_property methode : string either set, add, or clear zone : string name of zone key : string name of property value : string value of property ''' ret = {'status': True} ...
def _resource(methode, zone, resource_type, resource_selector, **kwargs): ''' internal resource hanlder methode : string add or update zone : string name of zone resource_type : string type of resource resource_selector : string unique resource identifier **k...
def update_resource(zone, resource_type, resource_selector, **kwargs): ''' Add a resource zone : string name of zone resource_type : string type of resource resource_selector : string unique resource identifier kwargs : string|int|... resource properties .. ...
def remove_resource(zone, resource_type, resource_key, resource_value): ''' Remove a resource zone : string name of zone resource_type : string type of resource resource_key : string key for resource selection resource_value : string value for resource selection ...
def info(zone, show_all=False): ''' Display the configuration from memory zone : string name of zone show_all : boolean also include calculated values like capped-cpu, cpu-shares, ... CLI Example: .. code-block:: bash salt '*' zonecfg.info tallgeese ''' ret = ...
def verify_hash_type(self): ''' Verify and display a nag-messsage to the log if vulnerable hash-type is used. :return: ''' if self.config['hash_type'].lower() in ['md5', 'sha1']: log.warning( 'IMPORTANT: Do not use %s hashing algorithm! Please set ' ...
def environment_failure(self, error): ''' Log environment failure for the daemon and exit with the error code. :param error: :return: ''' log.exception( 'Failed to create environment for %s: %s', self.__class__.__name__, get_error_message(error) ...
def prepare(self): ''' Run the preparation sequence required to start a salt master server. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).prepare() ''' super(Master, self).prepare() try: if self.config['verify_env']: ...
def start(self): ''' Start the actual master. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).start() NOTE: Run any required code before calling `super()`. ''' super(Master, self).start() if check_user(self.config['user']): ...
def shutdown(self, exitcode=0, exitmsg=None): ''' If sub-classed, run any shutdown operations on this method. ''' self.shutdown_log_info() msg = 'The salt master is shutdown. ' if exitmsg is not None: exitmsg = msg + exitmsg else: exitmsg =...
def prepare(self): ''' Run the preparation sequence required to start a salt minion. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).prepare() ''' super(Minion, self).prepare() try: if self.config['verify_env']: ...
def start(self): ''' Start the actual minion. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).start() NOTE: Run any required code before calling `super()`. ''' super(Minion, self).start() while True: try: ...
def call(self, cleanup_protecteds): ''' Start the actual minion as a caller minion. cleanup_protecteds is list of yard host addresses that should not be cleaned up this is to fix race condition when salt-caller minion starts up If sub-classed, don't **ever** forget to run: ...
def shutdown(self, exitcode=0, exitmsg=None): ''' If sub-classed, run any shutdown operations on this method. :param exitcode :param exitmsg ''' self.action_log_info('Shutting down') if hasattr(self, 'minion') and hasattr(self.minion, 'destroy'): self...
def prepare(self): ''' Run the preparation sequence required to start a salt proxy minion. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).prepare() ''' super(ProxyMinion, self).prepare() if not self.values.proxyid: self....
def start(self): ''' Start the actual proxy minion. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).start() NOTE: Run any required code before calling `super()`. ''' super(ProxyMinion, self).start() try: if check_...
def shutdown(self, exitcode=0, exitmsg=None): ''' If sub-classed, run any shutdown operations on this method. :param exitcode :param exitmsg ''' if hasattr(self, 'minion') and 'proxymodule' in self.minion.opts: proxy_fn = self.minion.opts['proxymodule'].loade...
def prepare(self): ''' Run the preparation sequence required to start a salt syndic minion. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).prepare() ''' super(Syndic, self).prepare() try: if self.config['verify_env']: ...
def start(self): ''' Start the actual syndic. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).start() NOTE: Run any required code before calling `super()`. ''' super(Syndic, self).start() if check_user(self.config['user']): ...
def shutdown(self, exitcode=0, exitmsg=None): ''' If sub-classed, run any shutdown operations on this method. :param exitcode :param exitmsg ''' self.action_log_info('Shutting down') super(Syndic, self).shutdown( exitcode, ('The Salt {0} is shutdown. ...
def __execute_cmd(command): ''' Execute rac commands ''' cmd = __salt__['cmd.run_all']('racadm {0}'.format(command)) if cmd['retcode'] != 0: log.warning('racadm return an exit code \'%s\'.', cmd['retcode']) return False return True
def nameservers(*ns): ''' Configure the nameservers on the DRAC CLI Example: .. code-block:: bash salt dell drac.nameservers [NAMESERVERS] salt dell drac.nameservers ns1.example.com ns2.example.com ''' if len(ns) > 2: log.warning('racadm only supports two nameservers')...
def syslog(server, enable=True): ''' Configure syslog remote logging, by default syslog will automatically be enabled if a server is specified. However, if you want to disable syslog you will need to specify a server followed by False CLI Example: .. code-block:: bash salt dell drac.s...
def list_users(): ''' List all DRAC users CLI Example: .. code-block:: bash salt dell drac.list_users ''' users = {} _username = '' for idx in range(1, 17): cmd = __salt__['cmd.run_all']('racadm getconfig -g \ cfgUserAdmin -i {0}'.format(idx)) ...
def delete_user(username, uid=None): ''' Delete a user CLI Example: .. code-block:: bash salt dell drac.delete_user [USERNAME] [UID - optional] salt dell drac.delete_user diana 4 ''' if uid is None: user = list_users() uid = user[username]['index'] if uid:...
def change_password(username, password, uid=None): ''' Change users password CLI Example: .. code-block:: bash salt dell drac.change_password [USERNAME] [PASSWORD] [UID - optional] salt dell drac.change_password diana secret ''' if uid is None: user = list_users() ...
def create_user(username, password, permissions, users=None): ''' Create user accounts CLI Example: .. code-block:: bash salt dell drac.create_user [USERNAME] [PASSWORD] [PRIVILEGES] salt dell drac.create_user diana secret login,test_alerts,clear_logs DRAC Privileges * logi...
def set_permissions(username, permissions, uid=None): ''' Configure users permissions CLI Example: .. code-block:: bash salt dell drac.set_permissions [USERNAME] [PRIVILEGES] [USER INDEX - optional] salt dell drac.set_permissions diana login,test_alerts,clear_logs 4 DRAC Privileg...
def server_pxe(): ''' Configure server to PXE perform a one off PXE boot CLI Example: .. code-block:: bash salt dell drac.server_pxe ''' if __execute_cmd('config -g cfgServerInfo -o \ cfgServerFirstBootDevice PXE'): if __execute_cmd('config -g cfgServerInfo -o cfgS...
def _get_mtime(): """ Get the modified time of the RPM Database. Returns: Unix ticks """ return os.path.exists(RPM_PATH) and int(os.path.getmtime(RPM_PATH)) or 0
def _get_checksum(): """ Get the checksum of the RPM Database. Returns: hexdigest """ digest = hashlib.sha256() with open(RPM_PATH, "rb") as rpm_db_fh: while True: buff = rpm_db_fh.read(0x1000) if not buff: break digest.update(...
def posttrans_hook(conduit): """ Hook after the package installation transaction. :param conduit: :return: """ # Integrate Yum with Salt if 'SALT_RUNNING' not in os.environ: with open(CK_PATH, 'w') as ck_fh: ck_fh.write('{chksum} {mtime}\n'.format(chksum=_get_checksum(),...
def _parse_master(path=MASTER_CF): ''' Parse the master.cf file. This file is essentially a whitespace-delimited columnar file. The columns are: service, type, private (yes), unpriv (yes), chroot (yes), wakeup (never), maxproc (100), command + args. This function parses out the columns, leaving emp...
def set_master(service, conn_type, private='y', unpriv='y', chroot='y', wakeup='n', maxproc='100', command='', write_conf=True, path=MASTER_CF): ''' Set a single config value in...
def _format_master(service, conn_type, private, unpriv, chroot, wakeup, maxproc, command): ''' Format the given values into the style of line normally used in the master.cf fi...
def _parse_main(path=MAIN_CF): ''' Parse files in the style of main.cf. This is not just a "name = value" file; there are other rules: * Comments start with # * Any whitespace at the beginning of a line denotes that that line is a continuation from the previous line. * The whitespace ru...
def set_main(key, value, path=MAIN_CF): ''' Set a single config value in the main.cf file. If the value does not already exist, it will be appended to the end. CLI Example: salt <minion> postfix.set_main mailq_path /usr/bin/mailq ''' pairs, conf_list = _parse_main(path) new_conf =...
def _write_conf(conf, path=MAIN_CF): ''' Write out configuration file. ''' with salt.utils.files.fopen(path, 'w') as fh_: for line in conf: line = salt.utils.stringutils.to_str(line) if isinstance(line, dict): fh_.write(' '.join(line)) else: ...
def show_queue(): ''' Show contents of the mail queue CLI Example: .. code-block:: bash salt '*' postfix.show_queue ''' cmd = 'mailq' out = __salt__['cmd.run'](cmd).splitlines() queue = [] queue_pattern = re.compile(r"(?P<queue_id>^[A-Z0-9]+)\s+(?P<size>\d+)\s(?P<timesta...
def delete(queue_id): ''' Delete message(s) from the mail queue CLI Example: .. code-block:: bash salt '*' postfix.delete 5C33CA0DEA salt '*' postfix.delete ALL ''' ret = {'message': '', 'result': True } if not queue_id: log.error('Require...
def collection_get_options(collection_name, **kwargs): ''' Get collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query CLI Example: .. code-block:: bash salt '*' solrcloud.collection_get_options collection_name ''' cluster = cluster_st...
def collection_set_options(collection_name, options, **kwargs): ''' Change collection options Additional parameters (kwargs) may be passed, they will be proxied to http.query Note that not every parameter can be changed after collection creation CLI Example: .. code-block:: bash sal...
def list(keystore, passphrase, alias=None, return_cert=False): ''' Lists certificates in a keytool managed keystore. :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the keystore :param alias: (Optional) If found, displays details on only t...
def add(name, keystore, passphrase, certificate, private_key=None): ''' Adds certificates to an existing keystore or creates a new one if necesssary. :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode the...
def remove(name, keystore, passphrase): ''' Removes a certificate from an existing keystore. Returns True if remove was successful, otherwise False :param name: alias for the certificate :param keystore: The path to the keystore file to query :param passphrase: The passphrase to use to decode t...
def store(bank, key, data, cachedir): ''' Store information in a file. ''' base = os.path.join(cachedir, os.path.normpath(bank)) try: os.makedirs(base) except OSError as exc: if exc.errno != errno.EEXIST: raise SaltCacheError( 'The cache directory, {0}...
def fetch(bank, key, cachedir): ''' Fetch information from a file. ''' inkey = False key_file = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key)) if not os.path.isfile(key_file): # The bank includes the full filename, and the key is inside the file key_file = os...