819
819
By default, nodes should be installed with the default installer, so
820
820
this returns `False`.
822
return self.tags.filter(name="use-traditional-installer").exists()
822
return not self.should_use_default_installer()
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`.
830
return not self.should_use_traditional_installer()
830
return self.tags.filter(name="use-fastpath-installer").exists()
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.
842
842
uti_tag, _ = Tag.objects.get_or_create(
843
name="use-traditional-installer")
843
name="use-fastpath-installer")
844
if uti_tag.definition != "":
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)
851
def use_default_installer(self):
852
"""Set this node to be installed with the default installer.
854
By default, nodes should be installed with the Fast Path installer.
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.
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)
851
def use_default_installer(self):
852
"""Set this node to be installed with the default installer.
854
By default, nodes should be installed with the Fast Path installer.
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.
861
uti_tag, _ = Tag.objects.get_or_create(
862
name="use-traditional-installer")
863
if uti_tag.definition != "":
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)