Loading...

anaconda-devel-list@redhat.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [lorax 2/2] Check if the volume id is not longer than 32 chars (#786832) Martin Gracik Fri Feb 17 07:01:53 2012


----- Original Message -----
> > diff --git a/src/pylorax/treebuilder.py
> > b/src/pylorax/treebuilder.py
> > index f2511b0..6ed68fe 100644
> > --- a/src/pylorax/treebuilder.py
> > +++ b/src/pylorax/treebuilder.py
> > @@ -23,6 +23,7 @@ logger = logging.getLogger("pylorax.treebuilder")
> >  import os, re
> >  from os.path import basename, isdir
> >  from subprocess import check_call, check_output
> > +import sys
> >  
> >  from sysutils import joinpaths, remove
> >  from shutil import copytree, copy2
> > @@ -155,6 +156,9 @@ class TreeBuilder(object):
> >          # NOTE: if you change isolabel, you need to change pungi
> >          to match, or
> >          # the pungi images won't boot.
> >          isolabel = volid or "{0.name} {0.version}
> >          {1.basearch}".format(product, arch)
> > +        if len(isolabel) > 32:
> > +            logger.fatal("the volume id cannot be longer than 32
> > characters")
> > +            sys.exit(1)
> >  
> >          # NOTE: if you pass an arg named "runtime" to a mako
> >          template it'll
> >          # clobber some mako internal variables - hence
> >          "runtime_img".
> 
> Have you started to do anything at this point?  If so, it'd be nicer
> to
> check the length way up front, right at argument processing time.

good point, there's already stuff happening before this, I will move the check 
somewhere where it is run earlier

> 
> - Chris
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> [EMAIL PROTECTED]
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 

_______________________________________________
Anaconda-devel-list mailing list
[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/anaconda-devel-list