Source code for saltext.vcf.modules.vcf_vim_host_ssl_thumbprint

"""Execution module for ESXi SSL thumbprint fetch/validate."""

from saltext.vcf.clients import vim_host_ssl_thumbprint as c

__virtualname__ = "vcf_vim_host_ssl_thumbprint"


def __virtual__():
    return __virtualname__


[docs] def fetch(hostname, port=443, timeout=10): """Open a raw TLS connection to *hostname:port* and return the SHA-1 thumbprint. CLI Example: .. code-block:: bash salt '*' vcf_vim_host_ssl_thumbprint.fetch <hostname> """ return c.fetch(hostname, port=int(port), timeout=int(timeout))
[docs] def current(host, profile=None): """Return the thumbprint vCenter has cached for *host*. CLI Example: .. code-block:: bash salt '*' vcf_vim_host_ssl_thumbprint.current <host> """ return c.current(__opts__, host, profile=profile)
[docs] def validate(host, profile=None): """Compare the host's live thumbprint with the one vCenter knows about. CLI Example: .. code-block:: bash salt '*' vcf_vim_host_ssl_thumbprint.validate <host> """ return c.validate(__opts__, host, profile=profile)