

def take_action(self, parsed_args):
    self.log.debug('take_action(%s)', parsed_args)
    senlin_client = self.app.client_manager.clustering
    try:
        if ((not parsed_args.force) and sys.stdin.isatty()):
            sys.stdout.write(_('Are you sure you want to delete this node(s) [y/N]?'))
            prompt_response = sys.stdin.readline().lower()
            if (not prompt_response.startswith('y')):
                return
    except KeyboardInterrupt:
        self.log.info(_LI('Ctrl-c detected.'))
        return
    except EOFError:
        self.log.info(_LI('Ctrl-d detected'))
        return
    failure_count = 0
    for nid in parsed_args.node:
        try:
            senlin_client.delete_node(nid, False)
        except Exception as ex:
            failure_count += 1
            print(ex)
    if failure_count:
        raise exc.CommandError((_('Failed to delete %(count)s of the %(total)s specified node(s).') % {
            'count': ex,
            'total': len(parsed_args.node),
        }))
    print('Request accepted')

dataset/ETHPy150Open openstack/python-senlinclient/senlinclient/v1/node.py DeleteNode.take_action/VarMisuse@206/333 `failure_count`->`ex`