當前位置: 首頁>>代碼示例>>Python>>正文


Python Plenary.__init__方法代碼示例

本文整理匯總了Python中aquilon.worker.templates.base.Plenary.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Plenary.__init__方法的具體用法?Python Plenary.__init__怎麽用?Python Plenary.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在aquilon.worker.templates.base.Plenary的用法示例。


在下文中一共展示了Plenary.__init__方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
    def __init__(self, dbmetacluster, logger=LOGGER):
        Plenary.__init__(self, dbmetacluster, logger=logger)
        self.name = dbmetacluster.name

        # TODO maybe metaclusterdata
        self.plenary_core = "clusterdata"
        self.plenary_template = dbmetacluster.name
開發者ID:jrha,項目名稱:aquilon,代碼行數:9,代碼來源:metacluster.py

示例2: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
 def __init__(self, dbhost, logger=LOGGER):
     Plenary.__init__(self, dbhost, logger=logger)
     # Store the branch separately so get_key() works even after the dbhost
     # object has been deleted
     self.branch = dbhost.branch
     self.name = dbhost.fqdn
     self.plenary_core = "hostdata"
     self.plenary_template = self.name
開發者ID:stdweird,項目名稱:aquilon,代碼行數:10,代碼來源:host.py

示例3: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
 def __init__(self, dbcluster, logger=LOGGER):
     Plenary.__init__(self, dbcluster, logger=logger)
     self.name = dbcluster.name
     if dbcluster.metacluster:
         self.metacluster = dbcluster.metacluster.name
     else:
         self.metacluster = None
     self.plenary_core = "clusterdata"
     self.plenary_template = dbcluster.name
開發者ID:jrha,項目名稱:aquilon,代碼行數:11,代碼來源:cluster.py

示例4: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
    def __init__(self, dbmachine, logger=LOGGER):
        Plenary.__init__(self, dbmachine, logger=logger)
        self.machine = dbmachine.label

        loc = dbmachine.location
        self.hub = loc.hub.fullname.lower()
        self.building = loc.building.name
        self.city = loc.city.name
        self.continent = loc.continent.name

        if loc.rack:
            self.rack = loc.rack.name
            self.rackrow = loc.rack.rack_row
            self.rackcol = loc.rack.rack_column
        else:
            self.rack = None

        if loc.room:
            self.room = loc.room.name
        else:
            self.room = None

        if loc.bunker:
            self.bunker = loc.bunker.name
        else:
            self.bunker = None

        if loc.campus:
            self.campus = loc.campus.name
        else:
            self.campus = None

        self.dns_search_domains = []
        parents = loc.parents[:]
        parents.append(loc)
        parents.reverse()
        for parent in parents:
            # Filter out duplicates
            extra_domains = [map.dns_domain.name
                             for map in parent.dns_maps
                             if map.dns_domain.name not in self.dns_search_domains]
            self.dns_search_domains.extend(extra_domains)

        self.sysloc = loc.sysloc()

        # If this changes need to update machine_plenary_will_move() to match.
        self.plenary_core = "machine/%(hub)s/%(building)s/%(rack)s" % self.__dict__
        self.plenary_template = self.machine
開發者ID:jrha,項目名稱:aquilon,代碼行數:50,代碼來源:machine.py

示例5: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
 def __init__(self, dbservice, logger=LOGGER):
     Plenary.__init__(self, dbservice, logger=logger)
     self.plenary_core = "service/%s/server" % dbservice.name
     self.plenary_template = "config"
開發者ID:jrha,項目名稱:aquilon,代碼行數:6,代碼來源:service.py

示例6: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
 def __init__(self, dbcity, logger=LOGGER):
     Plenary.__init__(self, dbcity, logger=logger)
     self.plenary_core = "site/%s/%s" % (
         dbcity.hub.fullname.lower(), dbcity.name)
     self.plenary_template = "config"
開發者ID:jrha,項目名稱:aquilon,代碼行數:7,代碼來源:city.py

示例7: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
 def __init__(self, dbresource, logger=LOGGER):
     Plenary.__init__(self, dbresource, logger=logger)
     self.type = dbresource.resource_type
     self.name = dbresource.name
     self.plenary_core = dbresource.template_base
     self.plenary_template = "config"
開發者ID:stdweird,項目名稱:aquilon,代碼行數:8,代碼來源:resource.py

示例8: __init__

# 需要導入模塊: from aquilon.worker.templates.base import Plenary [as 別名]
# 或者: from aquilon.worker.templates.base.Plenary import __init__ [as 別名]
 def __init__(self, dbswitch, logger=LOGGER):
     Plenary.__init__(self, dbswitch, logger=logger)
     self.dbobj = dbswitch
     self.name = str(dbswitch.primary_name)
     self.plenary_core = "switchdata"
     self.plenary_template = self.name
開發者ID:jrha,項目名稱:aquilon,代碼行數:8,代碼來源:switch.py


注:本文中的aquilon.worker.templates.base.Plenary.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。