Пример #1
0
	def importTargetList(self):
		xmlparse = XMLParse(xml_file_path=DEPLOY_DESIGN_FILE_URL['Target'])
		for target in xmlparse.query('Target'):
			targetProviderList = []
			componentName = target.attrib['SpecName']
			componentVersion = target.attrib['specVersion']
			runtime_type = target._children[0]._children[0]._children[1].\
				_children[1]._children[0].attrib['Type']

			for element in target._children:
				if element.tag == 'TargetProvider':
					targetProviderList.append(element)

			targetProvider = targetProviderList
			self.targetList.append(DeployTarget(componentName = componentName,
												componentVersion = componentVersion,
												runtime_type = runtime_type,
												targetProvider = targetProvider))
Пример #2
0
    def loadDeploySchema(self):

        xmlparse = XMLParse(
            xml_file_path=DEPLOY_DESIGN_FILE_URL['DeploySchema'])
        deploySchema = xmlparse.query('DeploySchema')
        for schema in deploySchema:
            targetInstanceList = schema[0]._children
            containerInstanceList = schema[1]._children
            targetInstanceContainerInstanceMapping = schema[2]._children
            self.deploySchemaList.append(
                DeploySchema(targetInstList=targetInstanceList,
                             containerInstList=containerInstanceList,
                             targetRoleMapping=self.loadTargetRoleMapping(),
                             targetInstContainerMapping=
                             targetInstanceContainerInstanceMapping,
                             schema_name=self.xmlcmdbobserver.getDataCenter()
                             [0].attrib['name']))
        return
Пример #3
0
	def getTargetNameByUID(self, UID):
		xmlparse = XMLParse(xml_file_path=DEPLOY_DESIGN_FILE_URL['Target'])
		for target in  xmlparse.query('Target'):
			
			if UID == target.attrib['TargetUID']:
				return target.attrib['SpecName']
Пример #4
0
 def loadRole2Devices(self):
     xmlparse = XMLParse(
         xml_file_path=DEPLOY_DESIGN_FILE_URL['Role2DeviceMapping'])
     return xmlparse.query('MappingItem')
Пример #5
0
 def load_roles(self):
     xmlparse = XMLParse(xml_file_path=DEPLOY_DESIGN_FILE_URL['Role'])
     return xmlparse.query('Role')
Пример #6
0
 def __init__(self):
     self.xmlparse = XMLParse(
         xml_file_path=DEPLOY_DESIGN_FILE_URL['EnvResource'])
Пример #7
0
 def loadTargetRoleMapping(self):
     xmlparse = XMLParse(
         xml_file_path=DEPLOY_DESIGN_FILE_URL['TargetRoleMapping'])
     targetRoleMapping = xmlparse.query('TargetToRoleMapping')
     return targetRoleMapping[0]._children