示例#1
0
文件: __init__.py 项目: rizumu/salt
    def run(self):
        """
        Execute salt-key
        """
        self.parse_args()

        if self.config["verify_env"]:
            verify_env_dirs = []
            if not self.config["gen_keys"]:
                verify_env_dirs.extend(
                    [
                        self.config["pki_dir"],
                        os.path.join(self.config["pki_dir"], "minions"),
                        os.path.join(self.config["pki_dir"], "minions_pre"),
                        os.path.join(self.config["pki_dir"], "minions_rejected"),
                        os.path.dirname(self.config["key_logfile"]),
                    ]
                )

            verify_env(
                verify_env_dirs,
                self.config["user"],
                permissive=self.config["permissive_pki_access"],
                pki_dir=self.config["pki_dir"],
            )

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        key.run()
示例#2
0
    def run(self):
        '''
        Execute salt-key
        '''
        self.parse_args()

        if self.config['verify_env']:
            verify_env_dirs = []
            if not self.config['gen_keys']:
                verify_env_dirs.extend([
                    self.config['pki_dir'],
                    os.path.join(self.config['pki_dir'], 'minions'),
                    os.path.join(self.config['pki_dir'], 'minions_pre'),
                    os.path.join(self.config['pki_dir'], 'minions_rejected'),
                ])

            verify_env(
                verify_env_dirs,
                self.config['user'],
                permissive=self.config['permissive_pki_access'],
                pki_dir=self.config['pki_dir'],
            )
            if not self.config['log_file'].startswith(
                ('tcp://', 'udp://', 'file://')):
                # Logfile is not using Syslog, verify
                verify_files([self.config['key_logfile']], self.config['user'])

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        if check_user(self.config['user']):
            key.run()
示例#3
0
文件: __init__.py 项目: mika/salt-deb
    def run(self):
        '''
        Execute salt-key
        '''
        self.parse_args()

        if self.config['verify_env']:
            verify_env_dirs = []
            if not self.config['gen_keys']:
                verify_env_dirs.extend([
                    self.config['pki_dir'],
                    os.path.join(self.config['pki_dir'], 'minions'),
                    os.path.join(self.config['pki_dir'], 'minions_pre'),
                    os.path.join(self.config['pki_dir'], 'minions_rejected'),
                    os.path.dirname(self.config['key_logfile'])
                ])

            verify_env(
                verify_env_dirs,
                self.config['user'],
                permissive=self.config['permissive_pki_access'],
                pki_dir=self.config['pki_dir'],
            )

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        key.run()
示例#4
0
    def run(self):
        '''
        Execute salt-key
        '''
        self.parse_args()

        if self.config['verify_env']:
            verify_env_dirs = []
            if not self.config['gen_keys']:
                verify_env_dirs.extend([
                    self.config['pki_dir'],
                    os.path.join(self.config['pki_dir'], 'minions'),
                    os.path.join(self.config['pki_dir'], 'minions_pre'),
                    os.path.join(self.config['pki_dir'], 'minions_rejected'),
                ])

            verify_env(
                verify_env_dirs,
                self.config['user'],
                permissive=self.config['permissive_pki_access'],
                pki_dir=self.config['pki_dir'],
            )
            if (not self.config['key_logfile'].startswith('tcp://') or
                    not self.config['key_logfile'].startswith('udp://') or
                    not self.config['key_logfile'].startswith('file://')):
                # Logfile is not using Syslog, verify
                verify_files(
                    [self.config['key_logfile']],
                    self.config['user']
                )

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        key.run()
示例#5
0
文件: __init__.py 项目: vlaci/salt
    def run(self):
        '''
        Execute salt-key
        '''
        self.parse_args()

        if self.config['verify_env']:
            verify_env_dirs = []
            if not self.config['gen_keys']:
                verify_env_dirs.extend([
                    self.config['pki_dir'],
                    os.path.join(self.config['pki_dir'], 'minions'),
                    os.path.join(self.config['pki_dir'], 'minions_pre'),
                    os.path.join(self.config['pki_dir'], 'minions_rejected'),
                    os.path.dirname(self.config['key_logfile'])
                ])

            verify_env(
                verify_env_dirs,
                self.config['user'],
                permissive=self.config['permissive_pki_access'],
                pki_dir=self.config['pki_dir'],
            )

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        key.run()
示例#6
0
    def run(self):
        """
        Execute salt-key
        """
        import salt.key

        self.parse_args()

        key = salt.key.KeyCLI(self.config)
        if check_user(self.config["user"]):
            key.run()
示例#7
0
    def run(self):
        '''
        Execute salt-key
        '''
        import salt.key
        self.parse_args()

        self.setup_logfile_logger()
        verify_log(self.config)

        key = salt.key.KeyCLI(self.config)
        if check_user(self.config['user']):
            key.run()
示例#8
0
    def run(self):
        '''
        Execute salt-key
        '''

        import salt.key
        self.parse_args()

        if self.config['verify_env']:
            verify_env_dirs = []
            if not self.config['gen_keys']:
                if self.config['transport'] == 'raet':
                    verify_env_dirs.extend([
                        self.config['pki_dir'],
                        os.path.join(self.config['pki_dir'], 'accepted'),
                        os.path.join(self.config['pki_dir'], 'pending'),
                        os.path.join(self.config['pki_dir'], 'rejected'),
                    ])
                elif self.config['transport'] == 'zeromq':
                    verify_env_dirs.extend([
                        self.config['pki_dir'],
                        os.path.join(self.config['pki_dir'], 'minions'),
                        os.path.join(self.config['pki_dir'], 'minions_pre'),
                        os.path.join(self.config['pki_dir'], 'minions_rejected'),
                    ])

            verify_env(
                verify_env_dirs,
                self.config['user'],
                permissive=self.config['permissive_pki_access'],
                pki_dir=self.config['pki_dir'],
            )
            if not self.config['log_file'].startswith(('tcp://',
                                                       'udp://',
                                                       'file://')):
                # Logfile is not using Syslog, verify
                verify_files(
                    [self.config['key_logfile']],
                    self.config['user']
                )

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        if check_user(self.config['user']):
            key.run()
示例#9
0
文件: key.py 项目: DaveQB/salt
    def run(self):
        '''
        Execute salt-key
        '''
        import salt.key
        self.parse_args()
        multi = False
        if self.config.get('zmq_behavior') and self.config.get('transport') == 'raet':
            multi = True

        self.setup_logfile_logger()

        if multi:
            key = salt.key.MultiKeyCLI(self.config)
        else:
            key = salt.key.KeyCLI(self.config)
        if check_user(self.config['user']):
            key.run()
示例#10
0
    def run(self):
        """
        Execute salt-key
        """
        self.parse_args()

        if self.config["verify_env"]:
            verify_env_dirs = []
            if not self.config["gen_keys"]:
                if self.config["transport"] == "raet":
                    verify_env_dirs.extend(
                        [
                            self.config["pki_dir"],
                            os.path.join(self.config["pki_dir"], "accepted"),
                            os.path.join(self.config["pki_dir"], "pending"),
                            os.path.join(self.config["pki_dir"], "rejected"),
                        ]
                    )
                elif self.config["transport"] == "zeromq":
                    verify_env_dirs.extend(
                        [
                            self.config["pki_dir"],
                            os.path.join(self.config["pki_dir"], "minions"),
                            os.path.join(self.config["pki_dir"], "minions_pre"),
                            os.path.join(self.config["pki_dir"], "minions_rejected"),
                        ]
                    )

            verify_env(
                verify_env_dirs,
                self.config["user"],
                permissive=self.config["permissive_pki_access"],
                pki_dir=self.config["pki_dir"],
            )
            if not self.config["log_file"].startswith(("tcp://", "udp://", "file://")):
                # Logfile is not using Syslog, verify
                verify_files([self.config["key_logfile"]], self.config["user"])

        self.setup_logfile_logger()

        key = salt.key.KeyCLI(self.config)
        if check_user(self.config["user"]):
            key.run()
示例#11
0
文件: key.py 项目: mjura/salt-1
    def run(self):
        '''
        Execute salt-key
        '''
        import salt.key
        self.parse_args()
        multi = False
        if self.config.get('zmq_behavior') and self.config.get(
                'transport') == 'raet':
            multi = True

        self.setup_logfile_logger()

        if multi:
            key = salt.key.MultiKeyCLI(self.config)
        else:
            key = salt.key.KeyCLI(self.config)
        if check_user(self.config['user']):
            key.run()