Revision 57b8dd5a kamaki/client.py

b/kamaki/client.py
34 34
import json
35 35
import logging
36 36

  
37
from base64 import b64encode
38 37
from httplib import HTTPConnection, HTTPSConnection
39 38
from urlparse import urlparse
40 39

  
......
162 161
        
163 162
        req = {'name': name, 'flavorRef': flavor_id, 'imageRef': image_id}
164 163
        if personality:
165
            p = []
166
            for path, data in personality:
167
                contents = b64encode(data)
168
                p.append({'path': path, 'contents': contents})
169
            req['personality'] = p
164
            req['personality'] = personality
170 165
        
171 166
        body = json.dumps({'server': req})
172 167
        reply = self._post('/servers', body)

Also available in: Unified diff