def accept(self, match, include_rejected=False, include_denied=False):
        def _print_accepted(matches, after_match):
            if self.key.ACC in after_match:
                accepted = sorted(
                    set(after_match[self.key.ACC]).difference(
                        set(matches.get(self.key.ACC, []))
                    )
                )
                for key in accepted:
                    print('Key for minion {0} accepted.'.format(key))

        matches = self.key.name_match(match)
        keys = {}
        if self.key.PEND in matches:
            keys[self.key.PEND] = matches[self.key.PEND]
        if include_rejected and bool(matches.get(self.key.REJ)):
            keys[self.key.REJ] = matches[self.key.REJ]
        if include_denied and bool(matches.get(self.key.DEN)):
            keys[self.key.DEN] = matches[self.key.DEN]
        if not keys:
            msg = (
                'The key glob \'{0}\' does not match any unaccepted{1} keys.'
                .format(match, (('', ' or denied'),
                                (' or rejected', ', rejected or denied')
                               )[include_rejected][include_denied])
            )
            print(msg)
            raise salt.exceptions.SaltSystemExit(code=1)
        if not self.opts.get('yes', False):
            print('The following keys are going to be accepted:')
            salt.output.display_output(
                    keys,
                    'key',
                    self.opts)
            try:
                veri = input('Proceed? [n/Y] ')
            except KeyboardInterrupt:
                raise SystemExit("\nExiting on CTRL-c")
            if not veri or veri.lower().startswith('y'):
                _print_accepted(
                    matches,
                    self.key.accept(
                        match_dict=keys,
                        include_rejected=include_rejected,
                        include_denied=include_denied
                    )
                )
        else:
            print('The following keys are going to be accepted:')
            salt.output.display_output(
                    keys,
                    'key',
                    self.opts)
            _print_accepted(
                matches,
                self.key.accept(
                    match_dict=keys,
                    include_rejected=include_rejected,
                    include_denied=include_denied
                )
            )
Accept the keys matched
dataset/ETHPy150Open saltstack/salt/salt/key.py/KeyCLI.accept