from zope.interface import implements, providedBy
from abc import abstractproperty, abstractmethod, ABCMeta
+class abstractstatic(staticmethod):
+ __slots__ = ()
+ def __init__(self, function):
+ super(abstractstatic, self).__init__(function)
+ function.__isabstractmethod__ = True
+ __isabstractmethod__ = True
+
oslist = []
class OSNotDetected(Exception):
"""Wait for the OS to boot"""
pass
- @abstractmethod
- def testInit(self, parent):
+ @abstractstatic
+ def testInit(parent):
"""Instantiate a dummy version for unit testing"""
pass
def getPort(self, trafficType):
return self.parent._osParent_getPort(trafficType) or self.tcpCommunicationPorts[trafficType]
- @abstractmethod
def populateFromExisting(self):
"""Populate class members from an existing OS installation"""
pass
def __init__(self, distro, parent, password=None):
super(LinuxOS, self).__init__(distro, parent, password)
+ @staticmethod
+ def testInit(cls, parent): raise NotImplementedError()
+
+ @property
+ def canonicalDistroName(self): raise NotImplementedError()
+
+ @property
+ def waitForBoot(self): raise NotImplementedError()
+
def execSSH(self,
command,
username=None,
class XSDom0(LinuxOS):
def __init__(self, distro, parent, password=None):
super(XSDom0, self).__init__(distro, parent, password)
-
+
@staticmethod
def knownDistro(distro):
return distro == "XSDom0"
def testInit(parent):
return XSDom0("XSDom0", parent)
+ @property
+ def canonicalDistroName(self):
+ return "XSDom0"
+
def preCloneTailor(self):
pass