/usr/lib/python2.7/dist-packages/fts/bootplugin.py is in fts 1.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | # -*- coding: utf-8 -*-
from fts.config import Config
class BootPlugin(object):
def __init__(self):
"""
Plugins for FTS need to be inherited from BootPlugin in order to
provide the correct interface. Additionally, you have to announce
the plugin in your setup.py's [fts.plugin] entry point section,
so that it gets loaded on startup.
"""
self.config = Config.get_instance()
def getBootParams(self, address):
"""
This method tries to find a proper boot configuration for the given
address. If the address is no candidate for the current plugin, it
should return '''None'''.
========= ============================================================
Parameter Description
========= ============================================================
address Case insensitive MAC address, separator is ":"
========= ============================================================
``Return``: String or None
"""
raise NotImplemented("getBootParams(address) is not implemented")
def getInfo(self):
"""
Return a short description for the boot plugin.
``Return``: String
"""
raise NotImplemented("getInfo() is not implemented")
def make_pxe_entry(self, kernel, append, label="Automatic FTS entry"):
"""
Return a valid PXE boot entry including the given parameters.
========= ============================================================
Parameter Description
========= ============================================================
kernel PXE path to the kernel
append Kernel append line
label String describing the current entry
========= ============================================================
``Return``: String
"""
if kernel == "localboot":
kernel = "localboot 0"
append = ""
else:
kernel = "kernel " + kernel
return """# This file has been automatically generated by the '%s'
# FTS plugin. It is dynamic - do not edit.
default fts
label fts
menu label %s
%s
%s
""" % (self.getInfo(), label, kernel, "append %s" % append if append else "")
|