예제 #1
0
class iBaseDiscovery(object):
    def __init__(self, registry):
        # TODO: Pass srcdir so we can add it to entitytype
        self.ref = registry
        self.protofactory = ProtocolFactory()

    def is_entitytype(self, pinfra, ipaddr, creds, protopref, driver_en,
                      pOptions):
        protofactory = self.protofactory.clone()
        if not protopref is None:
            protofactory.copy(protopref)
        entity = self.my_entitytype(pinfra, ipaddr, creds, protofactory)
        if not entity is None:
            entity.driver_en = driver_en
            entity.pOptions = pOptions
            if entity.connect():
                return entity
        return None

    def _get(self, pinfra):
        protofactory = self.protofactory.clone()
        return self.my_entitytype(pinfra, "ip", None, protofactory)

    def my_entitytype(self, pinfra, ipaddr, creds, pFactory):
        return None

    def my_aliases(self):
        return []
예제 #2
0
 def __init__(self, registry):
     # TODO: Pass srcdir so we can add it to entitytype
     self.ref = registry
     self.protofactory = ProtocolFactory()