[Libosinfo] [PATCH 1/2] script: API to query username pattern

Christophe Fergeau cfergeau at redhat.com
Wed Aug 26 13:02:15 UTC 2015


On Wed, Aug 26, 2015 at 01:21:07PM +0100, Zeeshan Ali (Khattak) wrote:
> >, there are known limitations on hostname format in
> > Windows iirc, and we also have user-realname and potentially
> > admin-password/user-password which could have length/character set
> > limitations. Rather than adding a new element for each of these, maybe
> > we'd be better off with
> > <param name="xxxx" policy="yyyy" format/pattern="zzzz"/> ?
> > (not sure how convenient it is to stuff a regexp in an XML attribute).
> 
> I'm not sure I follow your suggestion. Could you please provide an
> example or two?

Something like
diff --git a/data/install-scripts/debian.xml b/data/install-scripts/debian.xml
index b164b01..acb8d01 100644
--- a/data/install-scripts/debian.xml
+++ b/data/install-scripts/debian.xml
@@ -10,6 +10,7 @@
       <param name="l10n-timezone" policy="optional"/>
       <param name="l10n-language" policy="optional"/>
       <param name="target-disk" policy="optional"/>
+      <param name="user-login" policy="required" pattern="^[a-zA-Z][a-zA-Z0-9]*$"/>
     </config>
     <injection-method>initrd</injection-method>
     <!-- FIXME: The need of an internet connection may be avoidable. It is

(I think the fact that debian.xml currently does not have a <param name="user-login" policy="required">
entry is a bug ?)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20150826/44bb0c3a/attachment.sig>


More information about the Libosinfo mailing list