~lutostag/ubuntu/trusty/maas/1.5.4+keystone

« back to all changes in this revision

Viewing changes to src/maasserver/models/nodegroup.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Raphaël Badin, Julian Edwards, Jeroen Vermeulen, Gavin Panella, Andres Rodriguez
  • Date: 2013-03-04 11:49:44 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20130304114944-81my0hho8arxa3ix
Tags: 1.3+bzr1452+dfsg-0ubuntu1
* New upstream release.
  - MAAS file storage mechanism is shifting from a single shared
    namespace to a per-user namespace. Operators of the majority
    of MAAS systems will not notice any change. However, operators
    of the most complex installations may find that a new
    "shared-environment" user is created, and that some resources
    are reassigned to it, such as API credentials and SSH public
    keys. This provides a transitional environment that mimics the
    behaviour of a shared namespace.

[ Raphaël Badin ]
* debian/control: maas-region-controller depends on bind9utils.
  (LP: #1103195)
* debian/maas-dns.postinst: Call write_dns_config.
  (LP: #1085865).
* debian/maas-cluster-controller.postinst: Fix the name of the config
  file (/etc/maas/pserv.yaml and not /etc/maas/pserv.conf)
  (LP: #1083542).
* debian/extras/99-maas-sudoers: Add 'SETENV:' to sudo rule
  to allow preserving the environment when running
  /usr/sbin/maas-import-pxe-files via sudo.
* debian/maas-dns.postinst: fix permissions and group ownership of
  file /etc/bind/maas/named.conf.rndc.maas. (LP: #1066935)
* debian/control: Remove the dependency of maas-cluster-controller
  on rabbitmq-server. (LP: #1072744)
* debian/extras/99-maas-sudoers: Add sudo rule for script
  /usr/sbin/maas-import-pxe-files.
* debian/maas-cluster-controller.install: Removed commissioning-user-data
  script.

[ Julian Edwards ]
* debian/maas-region-controller.install: Remove installation of maas-gc; it
  is no longer required as upstream no longer stores files in the filesystem.
  (LP: #1069734)
* debian/maas-cluster-controller.postinst: Ensure that /etc/maas/pserv.yaml
  is updated when reconfiguring. (LP: #1081212)

[ Jeroen Vermeulen ]
* debian/maas-cluster-controller.install: Install import scripts.
* debian/maas-cluster-controller.postinst: Configure tgt (the iSCSI server)
  so the import script can install files to it.
* debian/maas-cluster-controller.postrm: Clean up tgt config.
* debian/maas-region-controller.install: Move import scripts out to the
  cluster controller, and drop the maas-import-isos compatibility script.
* debian/maas-region-controller.postinst: Remove tgt config.
* debian/maas-region-controller.postrm: Remove tgt config cleanup.
* Bump code revision to include latest user_data.template fixes.

[ Gavin Panella ]
* debian/extras/99-maas: squashfs image download is no longer needed.
* debian/maas-cluster-controller.install: maas-import-squashfs and its
  configuration file are no longer part of upstream.
* debian/maas-cluster-controller.install: The maas-import-pxe-files cron
  task is no longer used.
* debian/maas-cluster-controller.postinst: Remove leading comment
  markers from the 'generator' line in pserv.yaml.

[ Andres Rodriguez ]
* debian/control:
  - maas-cluster-controller Conflicts with tftpd-hpa (LP: #1076028)
  - maas-dns: Conflicts with dnsmasq
  - maas-cluster-controller Conflicts/Replaces maas-region-controller as
    import scripts are no longer shipped in the region.
  - debian/control: Depends on distro-info for maas-cluster-controller
    instead of maas-region-controller (LP: #1103194)
* debian/maas-cluster-controller.config: If URL has been detected,
  add /MAAS if it doesn't contain it. This helps upgrades from versions
  where DEFAULT_MAAS_URL didn't use /MAAS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    Token,
37
37
    )
38
38
from provisioningserver.omshell import generate_omapi_key
39
 
from provisioningserver.tasks import add_new_dhcp_host_map
 
39
from provisioningserver.tasks import (
 
40
    add_new_dhcp_host_map,
 
41
    import_boot_images,
 
42
    )
40
43
 
41
44
 
42
45
class NodeGroupManager(Manager):
130
133
        return self._mass_change_status(
131
134
            NODEGROUP_STATUS.PENDING, NODEGROUP_STATUS.ACCEPTED)
132
135
 
 
136
    def import_boot_images_accepted_clusters(self):
 
137
        """Import the boot images on all the accepted cluster controllers."""
 
138
        accepted_nodegroups = NodeGroup.objects.filter(
 
139
            status=NODEGROUP_STATUS.ACCEPTED)
 
140
        for nodegroup in accepted_nodegroups:
 
141
            nodegroup.import_boot_images()
 
142
 
133
143
 
134
144
NODEGROUP_CLUSTER_NAME_TEMPLATE = "Cluster %(uuid)s"
135
145
 
226
236
        """The name of the queue for tasks specific to this nodegroup."""
227
237
        return self.uuid
228
238
 
 
239
    def import_boot_images(self):
 
240
        """Import the pxe files on this cluster controller.
 
241
 
 
242
        The files are downloaded through the proxy defined in the config
 
243
        setting 'http_proxy' if defined.
 
244
        """
 
245
        # Avoid circular imports.
 
246
        from maasserver.models import Config
 
247
        config_parameters = {
 
248
            'http_proxy',
 
249
            'main_archive',
 
250
            'ports_archive',
 
251
            'cloud_images_archive',
 
252
        }
 
253
        task_kwargs = {
 
254
            name: Config.objects.get_config(name)
 
255
            for name in config_parameters
 
256
                if Config.objects.get_config(name) is not None}
 
257
        import_boot_images.apply_async(queue=self.uuid, kwargs=task_kwargs)
 
258
 
229
259
    def add_dhcp_host_maps(self, new_leases):
230
260
        if self.get_managed_interface() is not None and len(new_leases) > 0:
231
261
            # XXX JeroenVermeulen 2012-08-21, bug=1039362: the DHCP