Fix XML formatting for create server personality.

This fixes generating the XML of personality attribute in create_server()

Change-Id: I375304964f564866447d32f3560985c434378c4d
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
This commit is contained in:
Matthew Treinish 2012-08-16 16:57:08 -04:00
parent bc3bd240cc
commit 2dfc282dc2

View File

@ -168,7 +168,13 @@ class ServersClientXML(RestClientXML):
meta.append(Text(v))
metadata.append(meta)
server.append(Element("personality"))
if 'personality' in kwargs:
personality = Element('personality')
server.append(personality)
for k in kwargs['personality']:
temp = Element('file', path=k['path'])
temp.append(Text(k['contents']))
personality.append(temp)
resp, body = self.post('servers', str(Document(server)), self.headers)
server = self._parse_server(etree.fromstring(body))