vim-register API is_default parameter should accept only boolean values

Bug #1746538 reported by Nitesh Vanarase
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Medium
Nitesh Vanarase

Bug Description

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

Changed in tacker:
assignee: nobody → Nitesh Vanarase (nitesh-vanarase)
Revision history for this message
Trinh Nguyen (dangtrinhnt) wrote :

Hi Nitesh,
Did you fix this issue?
Thanks,

Revision history for this message
Nitesh Vanarase (nitesh-vanarase) wrote : RE: [Bug 1746538] Re: vim-register API is_default parameter should accept only boolean values
Download full text (16.7 KiB)

Hello Trinh,
Yes I have.
Thanks

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Trinh Nguyen
Sent: Saturday, February 24, 2018 5:00 PM
To: Vanarase, Nitesh <email address hidden>
Subject: [Bug 1746538] Re: vim-register API is_default parameter should accept only boolean values

Hi Nitesh,
Did you fix this issue?
Thanks,

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1746538

Title:
  vim-register API is_default parameter should accept only boolean
  values

Status in tacker:
  New

Bug description:
  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": {"nam...

Changed in tacker:
status: New → Fix Released
Revision history for this message
Nitesh Vanarase (nitesh-vanarase) wrote :

Code changes are done, testing is in progress will update the status once completed thoroughly.

Changed in tacker:
status: Fix Released → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.openstack.org/570337

Changed in tacker:
importance: Undecided → Medium
Changed in tacker:
assignee: Nitesh Vanarase (nitesh-vanarase) → Dinesh Bhor (dinesh-bhor)
Changed in tacker:
assignee: Dinesh Bhor (dinesh-bhor) → Nitesh Vanarase (nitesh-vanarase)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/570337
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=b2ac5b6702220f46fd92a51e1c8031bde577e11f
Submitter: Zuul
Branch: master

commit b2ac5b6702220f46fd92a51e1c8031bde577e11f
Author: nitesh vanarase <email address hidden>
Date: Tue Jan 23 17:32:26 2018 +0530

    VIM should accept valid boolean values for is_default

    In case of create VIM API, is_default_parameter accepts any string
    values like "abc" or "1234" and set the value as True. It should
    strictly check for valid boolean values.

    Fixed this issue by using convert_to_boolean validator. so now, if
    you pass any non-boolean value, it will return 400 error to the user.

    NOTE:
    The below test case fails if we inherit the test class
    '..tests.unit.base.TestCase' from '..tests.base.BaseTestCase' with
    KeyError:

    tacker.tests.unit.nfvo.test_nfvo_plugin.TestNfvoPlugin.
    test_create_ns_workflow_no_task_exception

    The reason behind the failure is, the raised exception
    '..extensions.nfvo.NoTasksException' expects that the 'action' and
    'resource' should be passed as arguments to the exception while raising
    it to form the exception message. If you don't pass these two arguments
    then it fails to form the exception message and raises KeyError.
    This happens because the '..tests.base.BaseTestCase' test class uses
    exception fixture and sets 'use_fatal_exceptions' to True always which
    results into not raising the raised exception again and it tries to
    form the exception message and pass it to the base class __init__ for
    further processing. It fails and raises KeyError while forming that
    exception message because in 'test_create_ns_workflow_no_task_exception'
    test case these arguments are not passed to the exception while
    raising.

    To fix this test case, passed the required 'action' and 'resource'
    arguments to the exception while raising it.

    DocImpact
    Closes-Bug: #1746538
    Change-Id: Ib533b38a48d31cb26eecdc546b20b0f99beeaa34

Changed in tacker:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.