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

« back to all changes in this revision

Viewing changes to src/maasserver/node_action.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2014-04-03 13:45:02 UTC
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20140403134502-8a6wvuqwyuekufh0
Tags: upstream-1.5+bzr2227
ImportĀ upstreamĀ versionĀ 1.5+bzr2227

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    Node,
45
45
    SSHKey,
46
46
    )
 
47
from maasserver.models.tag import Tag
47
48
from maasserver.utils import map_enum
48
49
 
49
50
# All node statuses.
198
199
        self.node.use_fastpath_installer()
199
200
        return "Node marked as using curtin for install."
200
201
 
 
202
    def inhibit(self):
 
203
        """Inhibit if ``use-fastpath-installer`` uses an expression."""
 
204
        tag, _ = Tag.objects.get_or_create(name="use-fastpath-installer")
 
205
        if tag.is_defined:
 
206
            return dedent("""\
 
207
            The use-fastpath-installer tag is defined with an
 
208
            expression. This expression must instead be updated to set
 
209
            this node to install with the fast installer.
 
210
            """)
 
211
        else:
 
212
            return None
 
213
 
201
214
 
202
215
class UseDI(NodeAction):
203
216
    """Set this node to use d-i for installation."""
216
229
        self.node.use_traditional_installer()
217
230
        return "Node marked as using the default installer."
218
231
 
 
232
    def inhibit(self):
 
233
        """Inhibit if ``use-fastpath-installer`` uses an expression."""
 
234
        tag, _ = Tag.objects.get_or_create(name="use-fastpath-installer")
 
235
        if tag.is_defined:
 
236
            return dedent("""\
 
237
            The use-fastpath-installer tag is defined with an
 
238
            expression. This expression must instead be updated to set
 
239
            this node to install with the default installer.
 
240
            """)
 
241
        else:
 
242
            return None
 
243
 
219
244
 
220
245
class StartNode(NodeAction):
221
246
    """Acquire and start a node."""