<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 08/13/2010 04:24 PM, Adam Young wrote:
<blockquote cite="mid:4C65AA16.1090204@redhat.com" type="cite">On
08/12/2010 09:35 AM, Pavel Zůna wrote:
  <br>
  <blockquote type="cite">On 2010-08-12 14:38, Rob Crittenden wrote:
    <br>
    <blockquote type="cite">Pavel Zůna wrote:
      <br>
      <blockquote type="cite">On 2010-08-12 04:46, Rob Crittenden
wrote:
        <br>
        <blockquote type="cite">Pavel Zůna wrote:
          <br>
          <blockquote type="cite">setattr and addattr can now be used
both to set all values of
            <br>
ANY attribute. the last setattr always resets the attribute to
            <br>
the specified value and all addattr append to it.
            <br>
            <br>
Examples:
            <br>
user-mod testuser --setattr=title=msc
            <br>
title: msc
            <br>
user-mod testuser --setattr=title=msb
            <br>
title: msb
            <br>
user-mod testuser --addattr=title=msc
            <br>
title: msb, msc
            <br>
user-mod testuser --setattr=title=
            <br>
title:
            <br>
user-mod testuser --setattr=title=msc --addattr=msb
            <br>
title: msc, msb
            <br>
user-mod testuser --setattr=title=ing --addattr=bc
            <br>
title: ing, bc
            <br>
user-mod testuser --setattr=title=doc
            <br>
title: doc
            <br>
            <br>
It's not very user friendly, but it's going to be used very very
            <br>
rarely in special conditions in the CLI and we can use it to save
            <br>
lots of JSON-RPC roundtrips in the webUI.
            <br>
            <br>
Pavel
            <br>
          </blockquote>
          <br>
It was my intention when I added addattr and setattr that one couldn't
          <br>
set already-defined params this way. They were silently ignored. So you
          <br>
couldn't do:
          <br>
          <br>
user-mod testuser --setattr=givenname=Jeff
          <br>
          <br>
This would be possible with this patch. Was that intentional?
          <br>
          <br>
BTW I have the start of a test suite for this functionality.
          <br>
          <br>
rob
          <br>
        </blockquote>
        <br>
Yes, it is intentional. I forgot to mention it in the description. I'm
        <br>
using setattr/addattr for everything in the webUI - it makes the code a
        <br>
lot simpler.
        <br>
      </blockquote>
      <br>
Doesn't that invalidate all the validators we have in the plugins? This
      <br>
is why I disallowed it.
      <br>
      <br>
rob
      <br>
    </blockquote>
    <br>
It does, but I see these options as something only experienced users,
who need to set something we don't support directly, will use.
Sometimes they might want to disable the validators, if they know what
they're doing. We could also make the setattr/addattr handler in
frontend.py detect if a there's a validator available and use it.
    <br>
    <br>
Validators in the webUI is still something we need to figure out. Adam
was proposing having validators in the form of regex strings, which is
not a bad idea as it's easy to implement on any platform/language. On
the other hand, I don't know if it's good enough for all parameters we
have.
    <br>
    <br>
Hmm. There's a lot to think about here actually. I'll make it my
homework for the weekend. :)
    <br>
    <br>
Pavel
    <br>
    <br>
_______________________________________________
    <br>
Freeipa-devel mailing list
    <br>
<a class="moz-txt-link-abbreviated" href="mailto:Freeipa-devel@redhat.com">Freeipa-devel@redhat.com</a>
    <br>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/freeipa-devel">https://www.redhat.com/mailman/listinfo/freeipa-devel</a>
    <br>
  </blockquote>
  <br>
  <br>
Here's my version, that just calls the parameter prior to updating the
attr.  I tested it with:
  <br>
  <br>
[root@ipa ~]# ipa user-mod --setattr uidnumber=555 kfrog
  <br>
---------------------
  <br>
Modified user "kfrog"
  <br>
---------------------
  <br>
  User login: kfrog
  <br>
  First name: Kermit
  <br>
  Last name: Frog
  <br>
  Home directory: /home/kfrog
  <br>
  Login shell: /bin/sh
  <br>
  UID: 555
  <br>
  Groups: ipausers
  <br>
[root@ipa ~]# ipa user-mod --setattr uidnumber=frog kfrog
  <br>
ipa: ERROR: invalid 'uidnumber': must be an integer
  <br>
  <br>
  <br>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Freeipa-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeipa-devel@redhat.com">Freeipa-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/">https://www.redhat.com/mailman/listinfo/</a></pre>
</blockquote>
Pushed to Master.  ACKed in IRC by rcrit, and based on a pzuna patch
reviewd by both myself and rcrit<br>
<br>
<blockquote cite="mid:4C65AA16.1090204@redhat.com" type="cite">
  <pre wrap="">freeipa-devel</pre>
</blockquote>
Since this was a diff to a Patch ACK<br>
</body>
</html>