<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Times New Roman, Times, serif">Hello,<br>
      <br>
    </font>
    <blockquote><font face="Times New Roman, Times, serif">Quite
        beginner in freeipa land, I am trying to add options to
        'user-add' sub-command but desperately failing to make it work.<br>
        I did the following modification:<br>
      </font>
      <blockquote><tt>diff --git a/ipalib/plugins/user.py
          b/ipalib/plugins/user.py</tt><tt><br>
        </tt><tt>index 9b21200..0c36e35 100644</tt><tt><br>
        </tt><tt>--- a/ipalib/plugins/user.py</tt><tt><br>
        </tt><tt>+++ b/ipalib/plugins/user.py</tt><tt><br>
        </tt><tt>@@ -365,6 +365,20 @@ class user(LDAPObject):</tt><tt><br>
        </tt><tt>             csv=True,</tt><tt><br>
        </tt><tt>             flags=['no_search'],</tt><tt><br>
        </tt><tt>         ),</tt><tt><br>
        </tt><tt>+        Flag('tostage?',</tt><tt><br>
        </tt><tt>+            doc=_('Create user in staging container'),</tt><tt><br>
        </tt><tt>+            flags=('no_search', 'virtual_attribute'),</tt><tt><br>
        </tt><tt>+            cli_name='to_stage',</tt><tt><br>
        </tt><tt>+            default=False,</tt><tt><br>
        </tt><tt>+        ),</tt><tt><br>
        </tt><tt>+        Str('uidstaged?',</tt><tt><br>
        </tt><tt>+           
          pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$',</tt><tt><br>
        </tt><tt>+            pattern_errmsg='may only include letters,
          numbers, _, -, . and $',</tt><tt><br>
        </tt><tt>+            maxlength=255,</tt><tt><br>
        </tt><tt>+            cli_name='from_staged',</tt><tt><br>
        </tt><tt>+            label=_('Activate the User currently in
          the staging container'),</tt><tt><br>
        </tt><tt>+            normalizer=lambda value: value.lower(),</tt><tt><br>
        </tt><tt>+        ),</tt><tt><br>
        </tt><tt>     )</tt><tt><br>
        </tt><tt> </tt><tt><br>
        </tt><tt>     def _normalize_and_validate_email(self, email,
          config=None):</tt><tt><br>
        </tt><tt>@@ -436,12 +450,16 @@ class user_add(LDAPCreate):</tt><tt><br>
        </tt><tt>     msg_summary = _('Added user "%(value)s"')</tt><tt><br>
        </tt><tt> </tt><tt><br>
        </tt><tt>     has_output_params = LDAPCreate.has_output_params +
          user_output_params</tt><tt><br>
        </tt><tt>+    </tt><tt><br>
        </tt><tt>+    #internal_options = ['tostage', 'uidstaged']</tt><tt><br>
        </tt><tt> </tt><tt><br>
        </tt><tt>     takes_options = LDAPCreate.takes_options + (</tt><tt><br>
        </tt><tt>         Flag('noprivate',</tt><tt><br>
        </tt><tt>             cli_name='noprivate',</tt><tt><br>
        </tt><tt>             doc=_('Don\'t create user private group'),</tt><tt><br>
        </tt><tt>         ),</tt><tt><br>
        </tt><tt>+</tt><tt><br>
        </tt><tt>+</tt><tt><br>
        </tt><tt>     )</tt><br>
      </blockquote>
      <font face="Times New Roman, Times, serif"><br>
        The command 'ipa user-add --help' succeeds giving me the correct
        help message. But when I try to add the user it fails:<br>
      </font>
      <blockquote><tt>ipa user-add foo --to-stage --first=foo --last=foo</tt><tt><br>
        </tt><tt>ipa: ERROR: Unknown option: tostage</tt><br>
      </blockquote>
      <font face="Times New Roman, Times, serif"><br>
        This seems to occur because the frontend find this is a
        'remaining' option.. but what does it means ?<br>
        I tried to add the new options as internal options, or with
        different names, but it gives the same results. <br>
        I know it is a very novice question, but I have really no idea I
        should fix it. Anyone know what I am missing ?<br>
        <br>
        regards<br>
        thierry<br>
      </font></blockquote>
  </body>
</html>