本文整理匯總了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