~narindergupta/+junk/opnfvfuel

« back to all changes in this revision

Viewing changes to src/mib/builders/centos.py

  • Committer: Blake Rouse
  • Date: 2015-03-11 15:52:11 UTC
  • Revision ID: blake.rouse@canonical.com-20150311155211-we4p88fd8q43i7q8
Enable buildout to work with stevedore. Enable stevedore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import os
11
11
import shutil
12
12
 
13
 
from mib.osystems import (
14
 
    OperatingSystemError,
15
 
    VirtInstallOS,
 
13
from mib.builders import (
 
14
    BuildError,
 
15
    VirtInstallBuilder,
16
16
    )
17
17
 
18
18
 
19
 
class CentOS(VirtInstallOS):
 
19
class CentOSBuilder(VirtInstallBuilder):
20
20
    """Builds the CentOS image for both amd64 and i386. Uses virt-install
21
21
    to perform this installation process."""
22
22
 
40
40
    def validate_params(self, params):
41
41
        """Validates the command line parameters."""
42
42
        if params.centos_edition not in ['6', '7']:
43
 
            raise OperatingSystemError(
 
43
            raise BuildError(
44
44
                "Unknown CentOS edition: %s." % params.centos_edition)
45
45
        if params.centos_edition == '7' and params.arch == 'i386':
46
 
            raise OperatingSystemError(
 
46
            raise BuildError(
47
47
                "Cannot generate CentOS 7 for i386, as only amd64 is "
48
48
                "supported.")
49
49
 
86
86
                "inst.cmdline inst.headless")
87
87
            self.initrd_inject = self.get_contrib_path(
88
88
                "centos7/centos7-amd64.ks")
89
 
        super(CentOS, self).build_image(params)
 
89
        super(CentOSBuilder, self).build_image(params)