from drivers.resource.fs import KEYWORDS from core.objects.svcdict import KEYS KEYS.register_driver( "fs", "ext2", name=__name__, keywords=KEYWORDS, )
DRIVER_BASENAME = "amazon" KEYWORDS = BASE_KEYWORDS + [ { "keyword": "volumes", "convert": "list", "at": True, "required": True, "text": "A whitespace separated list of amazon volumes. Any member of the list can be set to a special <key=value,key=value> value. In this case the provisioner will allocate a new volume with the specified characteristics and replace this member with the allocated volume id. The supported keys are the same as those supported by the awscli ec2 create-volume command: size, iops, availability-zone, snapshot, type and encrypted.", "example": "vol-123456 vol-654321" }, ] KEYS.register_driver( DRIVER_GROUP, DRIVER_BASENAME, name=__name__, keywords=KEYWORDS, ) def driver_capabilities(node=None): from utilities.proc import which data = [] if not which("ec2"): return data if os.path.exists("/sys/hypervisor/uuid"): with open("/sys/hypervisor/uuid", "r") as f: uuid = f.read().lower() if not uuid.startswith("ec2"): return data if os.path.exists("/sys/devices/virtual/dmi/id/product_uuid"):
"disk.lvm.vgname": "name", "disk.vg.vgname": "name", } REVERSE_DEPRECATED_KEYWORDS = { "disk.lvm.name": "vgname", "disk.vg.name": "vgname", } DEPRECATED_SECTIONS = { "vg": ["disk", "vg"], } KEYS.register_driver( DRIVER_GROUP, DRIVER_BASENAME, name=__name__, keywords=KEYWORDS, deprecated_sections=DEPRECATED_SECTIONS, deprecated_keywords=DEPRECATED_KEYWORDS, reverse_deprecated_keywords=REVERSE_DEPRECATED_KEYWORDS, driver_basename_aliases=DRIVER_BASENAME_ALIASES, ) def driver_capabilities(node=None): from utilities.proc import which if which("lsvg"): return ["disk.vg"] return [] # ajouter un dump regulier de la config des vg (pour ne pas manquer les extensions de vol) class DiskVg(BaseDisk):
"required": True, "at": True, "text": "Path of the device or file used as a virtual machine disk. The path@nodename can be used to to set up different path on each node." }, ] DEPRECATED_SECTIONS = { "vdisk": ["disk", "vdisk"], } KEYS.register_driver( DRIVER_GROUP, DRIVER_BASENAME, name=__name__, keywords=KEYWORDS, deprecated_sections=DEPRECATED_SECTIONS, ) class DiskVdisk(Resource): def __init__(self, name=None, path=None, **kwargs): super(DiskVdisk, self).__init__(type="disk.vdisk", **kwargs) self.name = name self.label = "vdisk %s" % self.name self.devpath = path def __str__(self): return "%s name=%s" % (super(DiskVdisk, self).__str__(), self.name)
DRIVER_BASENAME_ALIASES = ["oci"] KEYWORDS = [ { "keyword": "target", "convert": "list", "at": True, "required": True, "candidates": ["nodes", "drpnodes"], "text": "Destination nodes of the sync." }, ] KEYS.register_driver( DRIVER_GROUP, DRIVER_BASENAME, name=__name__, keywords=KEYWORDS, driver_basename_aliases=DRIVER_BASENAME_ALIASES, ) def driver_capabilities(node=None): data = [] from utilities.proc import which if which("docker") or which("docker.io"): data.append("container.docker") return data class SyncDocker(Sync): def __init__(self, target=None, **kwargs): super(SyncDocker, self).__init__(type="sync.docker", **kwargs)
{ "keyword": "file", "protoname": "loopfile", "at": True, "required": True, "text": "The loopback device backing file full path." }, ] DEPRECATED_SECTIONS = { "loop": ["disk", "loop"], } KEYS.register_driver( "disk", "loop", name=__name__, keywords=KEYWORDS, deprecated_sections=DEPRECATED_SECTIONS, ) class BaseDiskLoop(Resource): """ Base loopback device resource """ def __init__(self, loopfile=None, size=None, **kwargs): super(BaseDiskLoop, self).__init__(type="disk.loop", **kwargs) self.loopfile = loopfile self.size = size self.label = "loop %s" % loopfile
KW_DNS_UPDATE, KW_CHECK_CARRIER, KW_ALIAS, KW_EXPOSE, ] DEPRECATED_KEYWORDS = { "ip.cni.container_rid": "netns", } REVERSE_DEPRECATED_KEYWORDS = { "ip.cni.netns": "container_rid", } KEYS.register_driver( DRIVER_GROUP, DRIVER_BASENAME, name=__name__, keywords=KEYWORDS, deprecated_keywords=DEPRECATED_KEYWORDS, reverse_deprecated_keywords=REVERSE_DEPRECATED_KEYWORDS, ) def cni_plugins(node): path = node.oget("cni", "plugins") if os.path.exists(os.path.join(path, "bridge")): return path altpath = os.path.join(os.sep, "usr", "lib", "cni") if os.path.exists(os.path.join(altpath, "bridge")): return altpath altpath = os.path.join(os.sep, "usr", "libexec", "cni") if os.path.exists(os.path.join(altpath, "bridge")): return altpath return path