~smoser/ubuntu/trusty/maas/lp-1172566

« back to all changes in this revision

Viewing changes to src/provisioningserver/boot/tftppath.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Andres Rodriguez, Jason Hobbs, Jeroen Vermeulen
  • Date: 2014-04-03 13:45:02 UTC
  • mfrom: (1.2.27)
  • Revision ID: package-import@ubuntu.com-20140403134502-k8ocidn51k203zzw
Tags: 1.5+bzr2227-0ubuntu1
* New upstream bugfix release:
  - Fix catching exceptions raised by
    twisted.conch.ssh.keys.Key.fromString (LP: #1298788)
  - Fix validationg in default NodeGroupInterface.broadcast_ip making it
    optional. (LP: #1299374)
  - Drop install-pxe-bootloader as it conflicts with newer import script.
  - Remove references to old import script.
  - Fix changes that cause overwriting of existing entries.
  - Fix inappropriate ValidationError when defining networks with nested
    (but non-identical) address ranges. (LP: #1299114)
  - Fix issue where if a node does not provide an architecture type on dhcp
    request, or no other boot method is available for that architecture,
    the node still uses pxelinux.0 to boot. (LP: #1300285)
  - Take an advisory lock to prevent concurrent creation of the
    eventloops table. (LP: #1300363)
  - Remove the cloud_images_archive setting, as it conflicts with new
    import script. (LP: #1300587)
  - Add a 'logout confirmation' page. Using this, the logout action is
    protected against CSRF attacks because it uses a POST request, in
    conjunction with Django's CSRF protection feature. (LP: #1298790)
  - Fix cluster listings when dealing with large number of clusters by
    paginating it. (LP: #1301242)
  - Change list_boot_images() so that it can cope with a missing boot
    images directory: this happens if the reporting task runs before the
    images have been imported. (LP: #213984)
  - Fix internal server error on fast path installer. (LP: #1293676)
  - Fix uploading files using maas-cli. (LP: #1187826)
  - Fix SM15k Invalid Power Control and Fix enlisting machines with
    2.0 api. (LP: #1302818, LP: #1302819)

[ Andres Rodriguez ]
* debian/maas-cluster-controller.install: Install UEFI templates
* debian/maas-cluster-controller.dirs: Create 'boot-resources' dir.

[ Jason Hobbs ]
* debian/extras/99-maas: Allow access to keyserver.ubuntu.com via
  squid-deb-proxy.
 
[Jeroen Vermeulen]
* debian/maas-cluster-controller.postinst:
  - Make the tgt config link point to the new boot-resources dir.
* debian/maas-region-controller-min.dirs:
  - Don't create /var/lib/maas/tftp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    'locate_tftp_path',
21
21
    ]
22
22
 
 
23
import errno
23
24
from itertools import chain
 
25
from logging import getLogger
24
26
import os.path
25
27
 
26
28
 
 
29
logger = getLogger(__name__)
 
30
 
 
31
 
27
32
def compose_image_path(arch, subarch, release, label):
28
33
    """Compose the TFTP path for a PXE kernel/initrd directory.
29
34
 
135
140
    """
136
141
    # The sub-directories directly under tftproot, if they contain
137
142
    # images, represent architectures.
138
 
    potential_archs = list_subdirs(tftproot)
 
143
    try:
 
144
        potential_archs = list_subdirs(tftproot)
 
145
    except OSError as exception:
 
146
        if exception.errno == errno.ENOENT:
 
147
            # Directory does not exist, so return empty list.
 
148
            logger.warning("No boot images have been imported yet.")
 
149
            return []
 
150
        else:
 
151
            # Other error. Propagate.
 
152
            raise
139
153
 
140
154
    # Starting point for iteration: paths that contain only the
141
155
    # top-level subdirectory of tftproot, i.e. the architecture name.