summaryrefslogtreecommitdiffstats
path: root/installclasses/rhel.py
blob: d2f061bbd298f44d139d69863193a9329e7d62ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from installclass import BaseInstallClass
import rhpl
from rhpl.translate import N_
from constants import *
import os
import iutil

import logging
log = logging.getLogger("anaconda")

# custom installs are easy :-)
class InstallClass(BaseInstallClass):
    # name has underscore used for mnemonics, strip if you dont need it
    id = "rhel"
    name = N_("Red Hat Enterprise Linux")
    description = N_("The default installation of %s includes a set of "
                     "software applicable for general internet usage. "
                     "What additional tasks would you like your system "
                     "to include support for?") %(productName,)
    sortPriority = 10000
    allowExtraRepos = False
    if not productName.startswith("Red Hat Enterprise"):
        hidden = 1

    tasks = [(N_("Office and Productivity"), ["graphics", "office", "games", "sound-and-video"]),
             (N_("Software Development"), ["development-libs", "development-tools", "gnome-software-development", "x-software-development"],),
             (N_("Web server"), ["web-server"])]

    def setInstallData(self, anaconda):
	BaseInstallClass.setInstallData(self, anaconda)
        BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions,
                                                CLEARPART_TYPE_LINUX)

    def setGroupSelection(self, anaconda):
        grps = anaconda.backend.getDefaultGroups()
        map(lambda x: anaconda.backend.selectGroup(x), grps)

    def setSteps(self, dispatch):
	BaseInstallClass.setSteps(self, dispatch);
	dispatch.skipStep("partition")
	dispatch.skipStep("regkey", skip = 0)        

    # for rhel, we're putting the metadata under productpath
    def getPackagePaths(self, uri):
        rc = {}
        for (name, path) in self.repopaths.items():
            rc[name] = "%s/%s" %(uri, path)
        return rc

    def handleRegKey(self, key, intf):
#         if key is None or len(key) == 0:
#             intf.messageWindow(_("Registration Key Required"),
#                                _("A registration key is required to "
#                                  "install %s.  Please contact your support "
#                                  "representative if you did not receive a "
#                                  "key with your product." %(productName,)),
#                                type = "ok", custom_icon="error")
#             raise NoKeyError

        # simple and stupid for now... if C is in the key, add Clustering
        # if V is in the key, add Virtualization. etc
        if productPath == "Server" and rhpl.getArch() in ("i386", "x86_64", "ia64"):
            if key.find("C") != -1:
                self.repopaths["cluster"] = "Cluster"
                log.info("Adding Cluster option")
            if key.find("S") != -1:
                self.repopaths["cs"] = "ClusterStorage"
                log.info("Adding ClusterStorage option")

        if productPath == "Client":
            if key.find("D") != -1:
                self.repopaths["desktop"] = "Desktop"
                log.info("Adding Desktop option")
            if key.find("W") != -1:
                self.repopaths["desktop"] = "Workstation"
                log.info("Adding Workstation option")

        if rhpl.getArch() in ("i386", "x86_64", "ia64"):
            if key.find("V") != -1:
                self.repopaths["virt"] = "VT"
                log.info("Adding Virtualization option")

        self.regkey = key

    def __init__(self, expert):
	BaseInstallClass.__init__(self, expert)

        self.repopaths = { "base": "%s" %(productPath,) }
        self.regkey = None