def DSAppend(dstype, objectname, attribute, value):
  ds_path = '/%ss/%s' % (dstype.capitalize(), objectname)
  cmd = [_DSCL, '.', '-append', ds_path, attribute]
  if type(value) == type(list()):
    cmd.extend(value)
  else:
    cmd.append(value)
  (unused_stdout, stderr, returncode) = gmacpyutil.RunProcess(cmd)
  if returncode:
    raise DSException('Cannot append %s for %s: %s' % (attribute,
                                                       ds_path,
                                                       stderr))
DirectoryServices attribute append.
dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/ds.py/DSAppend