Changeset 450


Ignore:
Timestamp:
27-09-09 16:21:37 (4 years ago)
Author:
thomas
Message:
  • moap/util/distro.py: Add a DistroException?. Raise it when lsb_release is not present (like on the f11 buildslave)
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r448 r450  
     12009-09-27  Thomas Vander Stichele  <thomas at apestaart dot org> 
     2 
     3        * moap/util/distro.py: 
     4          Add a DistroException. 
     5          Raise it when lsb_release is not present (like on the f11 
     6          buildslave) 
     7 
    182009-09-25  Thomas Vander Stichele  <thomas at apestaart dot org> 
    29 
  • trunk/moap/util/distro.py

    r287 r450  
    1212Figure out what distribution, architecture and version the user is on. 
    1313""" 
     14 
     15class DistroException(Exception): 
     16    pass 
    1417 
    1518class Distro: 
     
    6770    """ 
    6871    # start with lsb_release 
    69     output = commands.getoutput("lsb_release -i") 
     72    (status, output) = commands.getstatusoutput("lsb_release -i") 
     73    if os.WIFEXITED(status): 
     74        ret = os.WEXITSTATUS(status) 
     75        if ret == 127: 
     76            raise DistroException('lsb_release binary not found') 
     77 
    7078    if output and output.startswith('Distributor ID:'): 
    7179        distributor = output.split(':', 2)[1].strip() 
Note: See TracChangeset for help on using the changeset viewer.