HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/cli/key.py
import salt.utils.parsers
from salt.exceptions import SaltInvocationError
from salt.utils.verify import check_user


class SaltKey(salt.utils.parsers.SaltKeyOptionParser):
    """
    Initialize the Salt key manager
    """

    def run(self):
        """
        Execute salt-key
        """
        import salt.key

        self.parse_args()
        if self.options.delete_all:
            if self.args:
                raise SaltInvocationError(
                    "Delete all takes no arguments. Use -d to delete specified keys"
                )

        key = salt.key.KeyCLI(self.config)
        if check_user(self.config["user"]):
            key.run()