[PATCH] fix version query and add one to the log file

Vratislav Podzimek vpodzime at redhat.com
Fri Mar 29 10:34:47 UTC 2013


On Thu, 2013-03-28 at 13:38 -0500, Mark Hamzy wrote:
> Fix "lorax -V" and add a "version is ???" to the log file so we can easily know
> what version of lorax is used to build an iso.
> 
> ---
>  src/pylorax/__init__.py   |  4 ++++
>  src/pylorax/buildstamp.py |  8 +-------
>  src/sbin/lorax            | 12 +++++++-----
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
> index 069628e..295ae53 100644
> --- a/src/pylorax/__init__.py
> +++ b/src/pylorax/__init__.py
> @@ -142,6 +142,8 @@ class Lorax(BaseLoraxClass):
>  
>          assert self._configured
>  
> +        from pylorax.version import num as vernum
> +
>          if domacboot:
>              try:
>                  runcmd(["rpm", "-q", "hfsplus-tools"])
> @@ -161,6 +163,8 @@ class Lorax(BaseLoraxClass):
>  
>          self.init_stream_logging()
>          self.init_file_logging(logdir)
> +
> +        logger.debug("version is {0}".format (vernum))
>          logger.debug("using work directory {0.workdir}".format(self))
>          logger.debug("using log directory {0}".format(logdir))
>  
> diff --git a/src/pylorax/buildstamp.py b/src/pylorax/buildstamp.py
> index 6953a6c..fbc7ff9 100644
> --- a/src/pylorax/buildstamp.py
> +++ b/src/pylorax/buildstamp.py
> @@ -38,13 +38,7 @@ class BuildStamp(object):
>          self.uuid = "{0}.{1}".format(now, buildarch)
>  
>      def write(self, outfile):
> -        # get lorax version
> -        try:
> -            import pylorax.version
> -        except ImportError:
> -            vernum = "devel"
> -        else:
> -            vernum = pylorax.version.num
> +        from pylorax.version import num as vernum
Maybe I'm missing something, but isn't the try-except still needed?

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list