~laney/ubuntu-archive-tools/retry-autopkgtest-regressions-bileto-v2

« back to all changes in this revision

Viewing changes to isotracker.py

  • Committer: Michael Vogt
  • Date: 2014-07-23 15:43:07 UTC
  • mto: This revision was merged to the branch mainline in revision 858.
  • Revision ID: michael.vogt@ubuntu.com-20140723154307-kuvydq5aurnxr4t4
do not sys.exit() inside the ISOTracker.__init__() but raise a exception instead

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
from qatracker import QATracker, QATrackerMilestone, QATrackerProduct
37
37
import os
38
 
import sys
 
38
 
 
39
class NoConfigurationError(Exception):
 
40
    pass
39
41
 
40
42
 
41
43
class ISOTracker:
46
48
        # Read configuration
47
49
        configfile = os.path.expanduser('~/.isotracker.conf')
48
50
        if not os.path.exists(configfile):
49
 
            print("Missing configuration file at: %s" % configfile)
50
 
            sys.exit(1)
 
51
            raise NoConfigurationError(
 
52
                "Missing configuration file at: %s" % configfile)
51
53
 
52
54
        # Load the config
53
55
        self.config = configparser.ConfigParser()