vaultmanager/modules/VaultManagerKV.py
def kv_delete(self, vault_addr, vault_token, paths):
        """
        Method running the delete function of KV module

        :param vault_addr: Vault instance URL
        :type vault_addr: str
        :param vault_token: Vault token
        :type vault_token: str
        :param paths: Paths to count
        :type paths: list(str)

        :return: dict of deleted secrets
        """
        self.logger.debug("KV delete starting")
        vault_client = self.connect_to_vault(
            vault_addr,
            vault_token
        )
        for to_delete in paths:
            self.logger.info("Deleting all secrets at and under %s at %s" %
                             (to_delete,
                              os.environ["VAULT_ADDR"]))
            secrets_to_delete = vault_client.secrets_tree_list(to_delete)
            if len(secrets_to_delete):
                for secret in secrets_to_delete:
                    self.logger.info("Deleting '" + secret + "'")
                    vault_client.delete(secret)
                self.logger.debug("%s secrets at '%s' successfully deleted" %
                                  (len(secrets_to_delete), to_delete))
            else:
                self.logger.error("No secrets to delete at '%s'" % to_delete)
        return secrets_to_delete

        Method running the delete function of KV module

        :param vault_addr: Vault instance URL
        :type vault_addr: str
        :param vault_token: Vault token
        :type vault_token: str
        :param paths: Paths to count
        :type paths: list(str)

        :return: dict of deleted secrets
        
Method running the delete function of KV module
Method running the delete function of KV module
def kv_delete(self, vault_addr, vault_token, paths):
        self.logger.debug("KV delete starting")
        vault_client = self.connect_to_vault(
            vault_addr,
            vault_token
        )
        for to_delete in paths:
            self.logger.info("Deleting all secrets at and under %s at %s" %
                             (to_delete,
                              os.environ["VAULT_ADDR"]))
            secrets_to_delete = vault_client.secrets_tree_list(to_delete)
            if len(secrets_to_delete):
                for secret in secrets_to_delete:
                    self.logger.info("Deleting '" + secret + "'")
                    vault_client.delete(secret)
                self.logger.debug("%s secrets at '%s' successfully deleted" %
                                  (len(secrets_to_delete), to_delete))
            else:
                self.logger.error("No secrets to delete at '%s'" % to_delete)
        return secrets_to_delete
def kv_delete ( self , vault_addr , vault_token , paths ) : self . logger . debug ( "KV delete starting" ) vault_client = self . connect_to_vault ( vault_addr , vault_token ) for to_delete in paths : self . logger . info ( "Deleting all secrets at and under %s at %s" % ( to_delete , os . environ [ "VAULT_ADDR" ] ) ) secrets_to_delete = vault_client . secrets_tree_list ( to_delete ) if len ( secrets_to_delete ) : for secret in secrets_to_delete : self . logger . info ( "Deleting '" + secret + "'" ) vault_client . delete ( secret ) self . logger . debug ( "%s secrets at '%s' successfully deleted" % ( len ( secrets_to_delete ) , to_delete ) ) else : self . logger . error ( "No secrets to delete at '%s'" % to_delete ) return secrets_to_delete
Method running the delete function of KV module
Method running the delete function of KV module
"""
        Method running the delete function of KV module

        :param vault_addr: Vault instance URL
        :type vault_addr: str
        :param vault_token: Vault token
        :type vault_token: str
        :param paths: Paths to count
        :type paths: list(str)

        :return: dict of deleted secrets
        """
dict of deleted secrets
dict of deleted secrets
self
vault_addr
Vault instance URL
Vault instance URL
vault_token
None
paths
Paths to count
Paths to count