Re: [lorax 2/2] Check if the volume id is not longer than 32 chars (#786832)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- 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
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux