SatelliteQE / nailgun

Why use a hammer when you can use a nailgun.
GNU General Public License v3.0
46 stars 83 forks source link

can't create Organization with Domain assigned #636

Open evgeni opened 5 years ago

evgeni commented 5 years ago
>>> d
nailgun.entities.Domain(dns=None, fullname=None, id=1, name=u'kangae.example.com')
>>> a = nailgun.entities.Organization(config, name='fooa', domain=[d], description="bar")
>>> a.create_payload()
{'domain_ids': [1], 'name': 'fooa', 'description': 'bar'}
>>> a.create()
nailgun.entities.Organization(domain=[], medium=[], description=u'bar', default_content_view=nailgun.entities.ContentView(id=6), library=nailgun.entities.LifecycleEnvironment(id=3), user=[], id=4, name=u'fooa', subnet=[], title=u'fooa', …)

I would have expected domain to be [1].

evgeni commented 5 years ago

in production.log, I see the following params passed:

Parameters: {"domain_ids"=>[1], "name"=>"fooa", "description"=>"bar", "api_version"=>"v2", "organization"=>{"name"=>"fooa", "description"=>"bar"}}

I think domain_ids should be inside organization.