当前位置: 首页>>代码示例>>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;未经允许,请勿转载。