python api error when security group is included in server.create()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Including a security group in the novaclient server.create() causes this error:
Traceback (most recent call last):
File "./scripts/
,security_
File "/usr/local/
**boot_kwargs)
File "/usr/local/
return_
File "/usr/local/
_resp, body = self.api.
File "/usr/local/
return self._cs_
File "/usr/local/
resp, body = self._time_
File "/usr/local/
resp, body = self.request(url, method, **kwargs)
File "/usr/local/
kwargs['data'] = json.dumps(
File "/usr/lib/
return _default_
File "/usr/lib/
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/
return _iterencode(o, 0)
File "/usr/lib/
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <SecurityGroup description=this is a test group, id=3, name=SECURITY_TEST, rules=[
Hi, unfortunately I see the parameter format for security_groups isn't present in the docstring of the public function, but is in the private function as:
:param security_groups: list of security group names
so I think the problem is that you haven't specified the security groups as a list of names.
This is an example:
>>> c.servers. create( 'hi', '731fcb9a- 29ac-4e8d- 9147-fa7d2a5c56 7f', 1, security_ groups= ['default' ])
<Server: hi>
>>> c.servers.list()
[<Server: hi>]
Can you confirm this is the problem? I will get the documentation updated to reflect the parameter description.