code: def pool_attr_add(arg, opts, shell_opts):
      
  
      res = Pool.list({ 'name': arg })
      if len(res) < 1:
          print("No pool with name '%s' found." % arg, file=sys.stderr)
          sys.exit(1)
  
      p = res[0]
  
      for avp in opts.get('extra-attribute', []):
          try:
              key, value = avp.split('=', 1)
          except ValueError:
              print("ERROR: Incorrect extra-attribute: %s. Accepted form: 'key=value'\n" % avp, file=sys.stderr)
              sys.exit(1)
  
          if key in p.avps:
              print("Unable to add extra-attribute: '%s' already exists." % key, file=sys.stderr)
              sys.exit(1)
  
          p.avps[key] = value
  
      try:
          p.save()
      except NipapError as exc:
          print("Could not save pool changes: %s" % str(exc), file=sys.stderr)
          sys.exit(1)
  
      print("Pool '%s' saved." % p.name)
docs: Add attributes to a pool