def do_singleton_action()

in curator/cli_singletons/object_class.py [0:0]


    def do_singleton_action(self, dry_run=False):
        """Execute the (ostensibly) completely ready to run action"""
        self.logger.debug('Doing the singleton "%s" action here.', self.action)
        try:
            if self.action == 'alias':
                action_obj = self.get_alias_obj()
            elif self.action in ['cluster_routing', 'create_index', 'rollover']:
                action_obj = self.action_class(self.client, **self.options)
            else:
                self.get_list_object()
                self.do_filters()
                self.logger.debug('OPTIONS = %s', self.options)
                action_obj = self.action_class(self.list_object, **self.options)
            if dry_run:
                action_obj.do_dry_run()
            else:
                action_obj.do_action()
        except NoIndices:  # Speficically to address #1704
            if not self.ignore:
                self.logger.critical('No indices in list after filtering. Exiting.')
                sys.exit(1)
            self.logger.info('No indices in list after filtering. Skipping action.')
        except Exception as exc:
            self.logger.critical(
                'Failed to complete action: %s. Exception: %s', self.action, exc
            )
            sys.exit(1)
        self.logger.info('"%s" action completed.', self.action)
        sys.exit(0)