def pool_attr_add(arg, opts, shell_opts):

    res = Pool.list({ 'name': arg })
    if len(res) < 1:
        print >> sys.stderr, "No pool with name '%s' found." % arg
        sys.exit(1)

    p = res[0]

    for avp in opts.get('extra-attribute', []):
        try:
            key, value = avp.split('=', 1)
        except ValueError:
            print >> sys.stderr, "ERROR: Incorrect extra-attribute: %s. Accepted form: 'key=value'\n" % avp
            sys.exit(1)

        if key in p.avps:
            print >> sys.stderr, "Unable to add extra-attribute: '%s' already exists." % key
            sys.exit(1)

        p.avps[key] = value

    try:
        p.save()
    except NipapError as exc:
        print >> sys.stderr, "Could not save pool changes: %s" % str(exc)
        sys.exit(1)

    print "Pool '%s' saved." % p.name
Backends can override this method if they can apply constraint
dataset/ETHPy150Open SpriteLink/NIPAP/nipap-cli/nipap_cli/nipap_cli.py/pool_attr_add--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/backends/__init__.py/BaseDatabaseWrapper.check_constraints