本文整理汇总了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
示例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
示例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
示例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
示例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"
示例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"
示例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"
示例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