Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeutronClient when get "security_group" resource will not filter by tenant_id, but the nova client will filter. #124

Open
zwqjoy opened this issue Aug 11, 2016 · 0 comments

Comments

@zwqjoy
Copy link

zwqjoy commented Aug 11, 2016

inputs_cfg = {
'username': 'Admin',
'password': 'password',
'auth_url': 'http://192.168.84.88:5000/v2.0',
'region': 'RegionOne',
'tenant_name': 'demo'
}

import openstack_plugin_common as common

nova_client, neut_client, cind_client, keys_client = common.NovaClient().get(config=inputs_cfg),
common.NeutronClient().get(config=inputs_cfg),
common.CinderClient().get(config=inputs_cfg),
common.KeystoneClient().get(config=inputs_cfg),

output:

common.get_resource_by_name_or_id('default', 'security_group', nova_client)

{'name': 'default'} 95fb874d-6d23-49b6-9aac-81125584c234

output:

common.get_resource_by_name_or_id('default', 'security_group', neut_client)

Traceback (most recent call last):
File "/Users/Wayne/WorkSpace/mycodebase/mypython/openstack-plugin/system_tests/test_client.py", line 55, in
common.get_resource_by_name_or_id('default', 'security_group', neut_client)
File "/Users/Wayne/WorkSpace/mycodebase/mypython/openstack-plugin/openstack_plugin_common/init.py", line 197, in get_resource_by_name_or_id
*_search_param)
File "/Users/Wayne/WorkSpace/mycodebase/mypython/openstack-plugin/openstack_plugin_common/init.py", line 616, in cosmo_get_if_exists
return self._cosmo_get(obj_type_single, True, *_kw)
File "/Users/Wayne/WorkSpace/mycodebase/mypython/openstack-plugin/openstack_plugin_common/init.py", line 626, in _cosmo_get
obj_type_single, kw, len(ls)))
cloudify.exceptions.NonRecoverableError: Expected at most one object of type security_group with match {'name': 'default'} but there are 5

Process finished with exit code 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant