~blake-rouse/maas/architecture-plugins

« back to all changes in this revision

Viewing changes to src/maasserver/preseed.py

[r=julian-edwards][bug=1315160][author=blake-rouse] Adds an operating system field 'osystem' to the BootImage model and restructures the boot-resources folder to add another level for osystem.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
94
94
def get_curtin_installer_url(node):
95
95
    """Return the URL where curtin on the node can download its installer."""
 
96
    osystem = 'ubuntu'
96
97
    series = node.get_distro_series()
97
98
    cluster_host = pick_cluster_controller_address(node)
98
99
    # XXX rvb(?): The path shouldn't be hardcoded like this, but rather synced
100
101
    arch, subarch = node.architecture.split('/')
101
102
    purpose = 'xinstall'
102
103
    image = BootImage.objects.get_latest_image(
103
 
        node.nodegroup, arch, subarch, series, purpose)
 
104
        node.nodegroup, osystem, arch, subarch, series, purpose)
104
105
    if image is None:
105
106
        raise MAASAPIException(
106
107
            "Error generating the URL of curtin's root-tgz file.  "
107
108
            "No image could be found for the given selection: "
108
 
            "arch=%s, subarch=%s, series=%s, purpose=%s." % (
 
109
            "os=%s, arch=%s, subarch=%s, series=%s, purpose=%s." % (
 
110
                osystem,
109
111
                arch,
110
112
                subarch,
111
113
                series,
112
114
                purpose
113
115
            ))
114
116
    dyn_uri = '/'.join([
 
117
        osystem,
115
118
        arch,
116
119
        subarch,
117
120
        series,