예제 #1
0
	def req_server_conf(self, request):
		cpuInfos = System.getCPUInfos()
		ram_total = System.getRAMTotal()
		
		doc = Document()
		rootNode = doc.createElement('configuration')
		
		rootNode.setAttribute("type", System.getName())
		rootNode.setAttribute("version", System.getVersion())
		rootNode.setAttribute("ram", str(ram_total))
		rootNode.setAttribute("ulteo_system", str(self.server.ulteo_system).lower())
		
		cpuNode = doc.createElement('cpu')
		cpuNode.setAttribute('nb_cores', str(cpuInfos[0]))
		textNode = doc.createTextNode(cpuInfos[1])
		cpuNode.appendChild(textNode)
		
		rootNode.appendChild(cpuNode)
		
		for role,dialog in self.server.role_dialogs:
			roleNode = doc.createElement('role')
			roleNode.setAttribute('name', dialog.getName())
			rootNode.appendChild(roleNode)
		
		doc.appendChild(rootNode)
		return self.req_answer(doc)
예제 #2
0
    def req_server_conf(self, request):
        cpuInfos = System.getCPUInfos()
        ram_total = System.getRAMTotal()

        doc = Document()
        rootNode = doc.createElement('configuration')

        rootNode.setAttribute("type", System.getName())
        rootNode.setAttribute("version", System.getVersion())
        rootNode.setAttribute("ram", str(ram_total))
        rootNode.setAttribute("ulteo_system",
                              str(self.server.ulteo_system).lower())

        cpuNode = doc.createElement('cpu')
        cpuNode.setAttribute('nb_cores', str(cpuInfos[0]))
        textNode = doc.createTextNode(cpuInfos[1])
        cpuNode.appendChild(textNode)

        rootNode.appendChild(cpuNode)

        for role, dialog in self.server.role_dialogs:
            roleNode = doc.createElement('role')
            roleNode.setAttribute('name', dialog.getName())
            rootNode.appendChild(roleNode)

        doc.appendChild(rootNode)
        return self.req_answer(doc)