Revision eb647cfe kamaki/clients/compute/__init__.py
b/kamaki/clients/compute/__init__.py | ||
---|---|---|
128 | 128 |
:param personality: a list of (file path, file contents) tuples, |
129 | 129 |
describing files to be injected into virtual server upon creation |
130 | 130 |
|
131 |
:param networks: (list of dicts) Networks to connect to, list this: |
|
132 |
"networks": [ |
|
133 |
{"network": <network_uuid>}, |
|
134 |
{"network": <network_uuid>, "fixed_ip": address}, |
|
135 |
{"port": <port_id>}, ...] |
|
136 |
ATTENTION: Empty list is different to None. None means ' do not |
|
137 |
mention it', empty list means 'automatically get an ip' |
|
138 |
|
|
131 | 139 |
:returns: a dict with the new virtual server details |
132 | 140 |
|
133 | 141 |
:raises ClientError: wraps request errors |
... | ... | |
141 | 149 |
if personality: |
142 | 150 |
req['server']['personality'] = personality |
143 | 151 |
|
144 |
if networks: |
|
145 |
req['server']['networks'] = networks |
|
152 |
if networks is not None:
|
|
153 |
req['server']['networks'] = networks or []
|
|
146 | 154 |
|
147 | 155 |
r = self.servers_post( |
148 | 156 |
json_data=req, |
Also available in: Unified diff