~ubuntu-branches/ubuntu/raring/maas/raring-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Chris Van Hook, Steve Langasek, Andres Rodriguez
  • Date: 2013-03-20 13:08:04 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20130320130804-ngvuxq6zg75h0ljr
Tags: 1.3+bzr1461+dfsg-0ubuntu1
* This is a new upstream bugfixs releases only. It includes:
  - Fix detection of non-existant ipmi device in nested kvm (LP: #1064527)
  - Fix IPMI User creation. (LP: #1119696)
  - Assign nodes to the correct nodegroup. (LP: #1148016)
  - Fix to provide useful error reporting for power management (LP: #1155175)

[ Chris Van Hook ]
* debian/patches/99-fix-ipmi-stat-lp1086160.patch: Fix ipmi power command
  to correctly use --stat. (LP: #1086160)

[ Steve Langasek ]
* Add missing dependency on iproute to maas-region-controller, for use of
  /sbin/ip in postinst.

[ Andres Rodriguez ]
* debian/patches/99-fix-maas-fpi.patch: Fix FPI, otherwise nodes have the
  risk of not being installed at all.
* debian/control: Depends on apache2 for maas-cluster-controller
* debian/maas-cluster-controller.install: Install maas-cluster-http.conf
* debian/maas-cluster-controller.{postinst,postrm}: Handle symlink and
  removal of maas-cluster-http.conf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
819
819
        By default, nodes should be installed with the default installer, so
820
820
        this returns `False`.
821
821
        """
822
 
        return self.tags.filter(name="use-traditional-installer").exists()
 
822
        return not self.should_use_default_installer()
823
823
 
824
824
    def should_use_default_installer(self):
825
825
        """Should this node be installed with the default installer?
827
827
        By default, nodes should be installed with the default installer, the
828
828
        Fast Path installer, so this returns `True`.
829
829
        """
830
 
        return not self.should_use_traditional_installer()
 
830
        return self.tags.filter(name="use-fastpath-installer").exists()
831
831
 
832
832
    def use_traditional_installer(self):
833
833
        """Set this node to be installed with the traditional installer.
840
840
            make with this method.
841
841
        """
842
842
        uti_tag, _ = Tag.objects.get_or_create(
843
 
            name="use-traditional-installer")
 
843
            name="use-fastpath-installer")
 
844
        if uti_tag.definition != "":
 
845
            raise RuntimeError(
 
846
                "The use-traditional-installer tag is defined with an "
 
847
                "expression. This expression much be updated to prevent "
 
848
                "this node from booting with the traditional installer.")
 
849
        self.tags.remove(uti_tag)
 
850
 
 
851
    def use_default_installer(self):
 
852
        """Set this node to be installed with the default installer.
 
853
 
 
854
        By default, nodes should be installed with the Fast Path installer.
 
855
 
 
856
        :raises: :class:`RuntimeError` when the `use-traditional-installer`
 
857
            tag is defined *with* an expression. The reason is that the tag
 
858
            evaluation machinery will eventually ignore whatever changes you
 
859
            make with this method.
 
860
        """
 
861
        uti_tag, _ = Tag.objects.get_or_create(
 
862
            name="use-fastpath-installer")
844
863
        if uti_tag.definition != "":
845
864
            raise RuntimeError(
846
865
                "The use-traditional-installer tag is defined with an "
847
866
                "expression. This expression much be updated to make this "
848
867
                "node boot with the traditional installer.")
849
868
        self.tags.add(uti_tag)
850
 
 
851
 
    def use_default_installer(self):
852
 
        """Set this node to be installed with the default installer.
853
 
 
854
 
        By default, nodes should be installed with the Fast Path installer.
855
 
 
856
 
        :raises: :class:`RuntimeError` when the `use-traditional-installer`
857
 
            tag is defined *with* an expression. The reason is that the tag
858
 
            evaluation machinery will eventually ignore whatever changes you
859
 
            make with this method.
860
 
        """
861
 
        uti_tag, _ = Tag.objects.get_or_create(
862
 
            name="use-traditional-installer")
863
 
        if uti_tag.definition != "":
864
 
            raise RuntimeError(
865
 
                "The use-traditional-installer tag is defined with an "
866
 
                "expression. This expression much be updated to prevent "
867
 
                "this node from booting with the traditional installer.")
868
 
        self.tags.remove(uti_tag)