Description
=======================
If user passes is_default parameter as 'abc' in the request body, still it creates a VIM with default value set to True.
It should only accept below values:
'0', ' 1', 'true', , 'false', True, False.
Steps to reproduce
=======================
For Example:
Curl command with is_default=“abc”:
curl -g -i -X POST http://10.232.48.219:9890/v1.0/vims.json -H "User-Agent: python-tackerclient" -H "Content-Type: application/json"
-H "Accept: application/json" -H "X-Auth-Token: 3c6f0240ef40455093a97264a3b9cf88"
-d '{"vim": {"description": "Default duplicate", "name": "VIMOpenStack3", "is_default": "abc",
"auth_cred":"username": "nfv_user", "user_domain_name": "Default", "password": "devstack"},
"auth_url": "http://10.232.48.219/identity/v3", "type": "openstack", "vim_project": {"name": "nfv", "project_domain_name": "Default"}}}'
Actual Result
=======================
It creates a VIM with is_default value set to True and returns 201.
Expected Result
=======================
It should return 400 error.
Error Message:
"Invalid input for is_default. Reason: 'abc' is not a valid boolean value.", "type": "HTTPBadRequest", "detail": ""
Service logs:
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.446 DEBUG tacker.wsgi [-] (773) accepted ('10.232.48.219', 37704) from (pid=773) server /usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py:883
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.449 DEBUG tacker.alarm_receiver [-] Process request: POST /v1.0/vims.json HTTP/1.0
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: Accept: application/json
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: Content-Length: 325
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: Content-Type: application/json
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: Host: 10.232.48.219:9890
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: User-Agent: python-tackerclient
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: X-Auth-Token: bb477a120ff34002b7dea602e22d81c7
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]:
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: {"vim": {"description": "Default VIM duplicate", "name": "VIM-OpenStack3", "is_default": "abc", "auth_cred": {"username": "nfv_user", "user_domain_name": "Default", "password": "devstack"}, "auth_url": "http://10.232.48.219/identity/v3", "type": "openstack", "vim_project": {"name": "nfv", "project_domain_name": "Default"}}} from (pid=773) process_request /opt/stack/tacker/tacker/alarm_receiver.py:43
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.646 WARNING oslo_config.cfg [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Option "policy_file" from group "DEFAULT" is deprecated. Use option "policy_file" from group "oslo_policy".
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.646 DEBUG oslo_policy._cache_handler [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Reloading cached file /etc/tacker/policy.json from (pid=773) read_cached_file /usr/local/lib/python2.7/dist-packages/oslo_policy/_cache_handler.py:40
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.656 DEBUG oslo_policy.policy [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Reloaded policy file: /etc/tacker/policy.json from (pid=773) _load_policy_file /usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py:757
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.690 DEBUG tacker.api.v1.base [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Request body: {u'vim': {u'description': u'Default VIM duplicate', u'vim_project': {u'name': u'nfv', u'project_domain_name': u'Default'}, u'is_default': u'abc', u'auth_url': u'http://10.232.48.219/identity/v3', u'auth_cred': {u'username': u'nfv_user', u'user_domain_name': u'Default', u'password': u'***'}, u'type': u'openstack', u'name': u'VIM-OpenStack3'}} from (pid=773) prepare_request_body /opt/stack/tacker/tacker/api/v1/base.py:510
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.691 DEBUG tacker.common.log [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] tacker.nfvo.nfvo_plugin.NfvoPlugin method create_vim called with arguments (<tacker.context.Context object at 0x7fbd7b4ee910>,) {'vim': {u'vim': {u'description': u'Default VIM duplicate', u'vim_project': {u'name': u'nfv', u'project_domain_name': u'Default'}, u'is_default': u'abc', u'auth_url': u'http://10.232.48.219/identity/v3', 'tenant_id': u'674715f2e8e74558beca1d54ec4c72c6', u'auth_cred': {u'username': u'nfv_user', u'user_domain_name': u'Default', u'password': u'***'}, u'type': u'openstack', u'name': u'VIM-OpenStack3'}}} from (pid=773) wrapper /opt/stack/tacker/tacker/common/log.py:34
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.691 DEBUG tacker.nfvo.nfvo_plugin [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Create vim called with parameters {u'vim': {u'description': u'Default VIM duplicate', u'vim_project': {u'name': u'nfv', u'project_domain_name': u'Default'}, u'is_default': u'abc', u'auth_url': u'http://10.232.48.219/identity/v3', 'tenant_id': u'674715f2e8e74558beca1d54ec4c72c6', u'auth_cred': {u'username': u'nfv_user', u'user_domain_name': u'Default', u'password': u'***'}, u'type': u'openstack', u'name': u'VIM-OpenStack3'}} from (pid=773) create_vim /opt/stack/tacker/tacker/nfvo/nfvo_plugin.py:104
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.692 DEBUG tacker.common.log [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] tacker.nfvo.drivers.vim.openstack_driver.OpenStack_Driver method register_vim called with arguments () {'vim_obj': {'status': 'PENDING', u'description': u'Default VIM duplicate', u'vim_project': {u'name': u'nfv', u'project_domain_name': u'Default'}, u'is_default': u'abc', u'auth_url': u'http://10.232.48.219/identity/v3', 'tenant_id': u'674715f2e8e74558beca1d54ec4c72c6', u'auth_cred': {u'username': u'nfv_user', u'user_domain_name': u'Default', u'password': u'***'}, u'type': u'openstack', 'id': 'c265ec14-5f62-45b6-b83c-f9267dc64c27', u'name': u'VIM-OpenStack3'}, 'context': <tacker.context.Context object at 0x7fbd7b4ee910>} from (pid=773) wrapper /opt/stack/tacker/tacker/common/log.py:34
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.692 DEBUG keystoneclient.session [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] REQ: curl -g -i -X GET http://10.232.48.219/identity/v3 -H "Accept: application/json" -H "User-Agent: python-keystoneclient" from (pid=773) _http_log_request /usr/local/lib/python2.7/dist-packages/keystoneclient/session.py:215
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.698 DEBUG keystoneclient.session [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] RESP: [200] Date: Wed, 31 Jan 2018 10:40:40 GMT Server: Apache/2.4.18 (Ubuntu) Vary: X-Auth-Token Content-Type: application/json Content-Length: 256 x-openstack-request-id: req-d1535080-6cee-4024-80eb-a09e498a769f Connection: close
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: RESP BODY: {"version": {"status": "stable", "updated": "2017-02-22T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.8", "links": [{"href": "http://10.232.48.219/identity/v3/", "rel": "self"}]}}
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: from (pid=773) _http_log_response /usr/local/lib/python2.7/dist-packages/keystoneclient/session.py:255
Jan 31 16:10:40 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:40.973 DEBUG tacker.common.log [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] tacker.nfvo.drivers.vim.openstack_driver.OpenStack_Driver method encode_vim_auth called with arguments (<tacker.context.Context object at 0x7fbd7b4ee910>, 'c265ec14-5f62-45b6-b83c-f9267dc64c27', {u'username': u'nfv_user', u'password': u'***', u'user_domain_name': u'Default', 'project_name': u'nfv', 'auth_url': u'http://10.232.48.219/identity/v3', 'project_id': None, 'project_domain_name': u'Default'}) {} from (pid=773) wrapper /opt/stack/tacker/tacker/common/log.py:34
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.123 DEBUG barbicanclient.client [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Creating Client object from (pid=773) Client /opt/stack/python-barbicanclient/barbicanclient/client.py:156
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.151 DEBUG barbicanclient.v1.secrets [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Request body: {'secret_type': 'opaque', 'payload_content_encoding': u'base64', 'payload': '<redacted>', 'payload_content_type': u'application/octet-stream'} from (pid=773) store /opt/stack/python-barbicanclient/barbicanclient/v1/secrets.py:337
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.576 DEBUG barbicanclient.client [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] Response status 201 from (pid=773) _check_status_code /opt/stack/python-barbicanclient/barbicanclient/client.py:87
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.577 DEBUG tacker.nfvo.drivers.vim.openstack_driver [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] VIM auth successfully stored for vim c265ec14-5f62-45b6-b83c-f9267dc64c27 from (pid=773) encode_vim_auth /opt/stack/tacker/tacker/nfvo/drivers/vim/openstack_driver.py:268
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.577 DEBUG tacker.nfvo.drivers.vim.openstack_driver [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] VIM registration completed for {'status': 'PENDING', u'description': u'Default VIM duplicate', u'vim_project': {u'name': u'nfv', u'project_domain_name': u'Default'}, 'placement_attr': {'regions': [u'RegionOne']}, u'is_default': u'abc', u'auth_url': u'http://10.232.48.219/identity/v3', 'tenant_id': u'674715f2e8e74558beca1d54ec4c72c6', u'auth_cred': {u'username': u'nfv_user', u'password': 'gAAAAABacZ0ogM3m5AdeXxa7wpLvQbjMgqVXiZNh01XjnBFgd4pJRRJRNKWc58d8Wccad3ggaTtandhQhmMt9w_6vMqKH_sUYw==', u'user_domain_name': u'Default', 'key_type': 'barbican_key', 'secret_uuid': u'ac6c28d8-44d5-4f98-b1bf-4bc88d084f73', 'project_name': u'nfv', 'auth_url': u'http://10.232.48.219/identity/v3', 'project_id': None, 'project_domain_name': u'Default'}, u'type': u'openstack', 'id': 'c265ec14-5f62-45b6-b83c-f9267dc64c27', u'name': u'VIM-OpenStack3'} from (pid=773) register_vim /opt/stack/tacker/tacker/nfvo/drivers/vim/openstack_driver.py:208
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.623 DEBUG oslo_db.sqlalchemy.engines [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION from (pid=773) _check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py:290
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.720 DEBUG tacker.common.log [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] tacker.db.common_services.common_services_db_plugin.CommonServicesPluginDb method create_event called with arguments (<tacker.context.Context object at 0x7fbd7b4ee910>,) {'res_type': 'vim', 'evt_type': 'CREATE', 'res_id': 'c265ec14-5f62-45b6-b83c-f9267dc64c27', 'res_state': 'PENDING', 'tstamp': datetime.datetime(2018, 1, 31, 10, 40, 41, 676129)} from (pid=773) wrapper /opt/stack/tacker/tacker/common/log.py:34
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.740 DEBUG tacker.common.log [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] tacker.nfvo.nfvo_plugin.NfvoPlugin method monitor_vim called with arguments (<tacker.context.Context object at 0x7fbd7b4ee910>, {'status': 'PENDING', u'description': u'Default VIM duplicate', u'vim_project': {u'name': u'nfv', u'project_domain_name': u'Default'}, 'placement_attr': {'regions': [u'RegionOne']}, u'is_default': u'abc', u'auth_url': u'http://10.232.48.219/identity/v3', 'tenant_id': u'674715f2e8e74558beca1d54ec4c72c6', u'auth_cred': {u'username': u'nfv_user', 'password': '***', u'user_domain_name': u'Default', 'key_type': 'barbican_key', 'secret_uuid': u'***', 'project_name': u'nfv', 'auth_url': u'http://10.232.48.219/identity/v3', 'project_id': None, 'project_domain_name': u'Default'}, u'type': u'openstack', 'id': 'c265ec14-5f62-45b6-b83c-f9267dc64c27', u'name': u'VIM-OpenStack3'}) {} from (pid=773) wrapper /opt/stack/tacker/tacker/common/log.py:34
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:41.850 DEBUG tacker.nfvo.workflows.vim_monitor.vim_monitor_utils [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] vim monitor workflow: version: '2.0'
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: vim_id_c265ec14-5f62-45b6-b83c-f9267dc64c27:
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: input:
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: - ping_vim
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: tasks:
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: monitor_ping_vimPingVIMTASK:
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: action: tacker.vim_ping_action
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: input:
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: count: '1'
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: interval: '1'
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: targetip: 10.232.48.219
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: timeout: '1'
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: vim_id: c265ec14-5f62-45b6-b83c-f9267dc64c27
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: type: direct
Jan 31 16:10:41 openstack-VirtualBox tacker-server[773]: from (pid=773) prepare_and_create_workflow /opt/stack/tacker/tacker/nfvo/workflows/vim_monitor/vim_monitor_utils.py:39
Jan 31 16:10:43 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:43.953 DEBUG mistralclient.api.httpclient [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] HTTP POST http://10.232.48.219:8989/v2/workflows?scope=private 201 from (pid=773) decorator /usr/local/lib/python2.7/dist-packages/mistralclient/api/httpclient.py:54
Jan 31 16:10:46 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:46.246 DEBUG mistralclient.api.httpclient [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] HTTP POST http://10.232.48.219:8989/v2/executions 201 from (pid=773) decorator /usr/local/lib/python2.7/dist-packages/mistralclient/api/httpclient.py:54
Jan 31 16:10:46 openstack-VirtualBox tacker-server[773]: 2018-01-31 16:10:46.248 INFO tacker.wsgi [req-78f60329-07cd-4d01-8adc-219b37d4306d admin admin] 10.232.48.219 - - [31/Jan/2018 16:10:46] "POST /v1.0/vims.json HTTP/1.1" 201 901 5.799148
Environment:
<tacker>
Author: dharmendra <email address hidden>
Date: Thu Jan 25 20:52:47 2018 +0000
save tenant_id in ACLMatchCriteria table
Because of null tenant_id, vnffg delete operation fails to delete
entry from ACLMatchCriteria.Hence delete attemp on parent table fails
with DBReferenceError.
Co-Authored-By: Dharmendra Kushwaha<email address hidden>
Closes-Bug: 1658364
Change-Id: I699f66dfa2eab49dc5239e70973b68967f4d0142
Devstack version:stable/pike version
Tacker version:0.10.0
Python-tackerclient version: Python 2.7.12
Hi Nitesh,
Did you fix this issue?
Thanks,