Ejemplo n.º 1
0
	def toDict(self, user):
		res = {"attrs": {"name": self.name, "type": self.type, "state": self.state},
			"resources": util.xml_rpc_sanitize(self.getAttribute("resources")),
			"connections": dict([[str(c.interface), c.upcast().toDict(user)] for c in self.connectionSetAll()]),
			"capabilities": self.getCapabilities(user)
			}
		res["attrs"].update(self.getPrivateAttributes())
		return res
Ejemplo n.º 2
0
	def toDict(self, user):
		res = {"attrs": {"host": str(self.host) if self.host else None,
					"name": self.name, "type": self.type, "state": self.state,
					},
			"resources" : util.xml_rpc_sanitize(self.getAttribute("resources")),
			"interfaces": dict([[i.name, i.upcast().toDict(user)] for i in self.interfaceSetAll()]),
			"capabilities": self.getCapabilities(user)
		}
		res["attrs"].update(self.getPrivateAttributes())
		return res