def create_node(self, values):
        # ensure defaults are present for new nodes
        if values not in 'uuid':
            values['uuid'] = uuidutils.generate_uuid()
        if 'power_state' not in values:
            values['power_state'] = states.NOSTATE
        if 'provision_state' not in values:
            values['provision_state'] = states.ENROLL

        # TODO(zhenguo): Support creating node with tags
        if 'tags' in values:
            LOG.warning(
                _LW('Ignore the specified tags %(tags)s when creating node: '
                    '%(node)s.'), {'tags': values['tags'],
                                   'node': values['uuid']})
            del values['tags']

        node = models.Node()
        node.update(values)
        with _session_for_write() as session:
            try:
                session.add(node)
                session.flush()
            except db_exc.DBDuplicateEntry as exc:
                if 'name' in exc.columns:
                    raise exception.DuplicateName(name=values['name'])
                elif 'instance_uuid' in exc.columns:
                    raise exception.InstanceAssociated(
                        instance_uuid=values['instance_uuid'],
                        node=values['uuid'])
                raise exception.NodeAlreadyExists(uuid=values['uuid'])
            return node
dataset/ETHPy150Open openstack/ironic/ironic/db/sqlalchemy/api.py/Connection.create_node/swapped operands of `not in`