Validator for NodeHandler doesn't catch incorrect group_id

Bug #1494835 reported by Aleksey Kasatkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Medium
Ryan Moe

Bug Description

VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "7.0"
  openstack_version: "2015.1.0-7.0"
  api: "1.0"
  build_number: "288"
  build_id: "288"
  nailgun_sha: "93477f9b42c5a5e0506248659f40bebc9ac23943"
  python-fuelclient_sha: "1ce8ecd8beb640f2f62f73435f4e18d1469979ac"
  fuel-agent_sha: "082a47bf014002e515001be05f99040437281a2d"
  fuel-nailgun-agent_sha: "d7027952870a35db8dc52f185bb1158cdd3d1ebd"
  astute_sha: "a717657232721a7fafc67ff5e1c696c9dbeb0b95"
  fuel-library_sha: "121016a09b0e889994118aa3ea42fa67eabb8f25"
  fuel-ostf_sha: "1f08e6e71021179b9881a824d9c999957fcc7045"
  fuelmain_sha: "6b83d6a6a75bf7bca3177fcf63b2eebbf1ad0a85"

The following is resulted in 500 error when node group with provided id does not exist:

[root@nailgun ~]# fuel --env 1 nodegroup --assign --node 1 --group 3
DEPRECATION WARNING: /etc/fuel/client/config.yaml exists and will be used as the source for settings. This behavior is deprecated. Please specify the path to your custom settings file in the FUELCLIENT_CUSTOM_SETTINGS environment variable.
500 Server Error: Internal Server Error ((IntegrityError) insert or update on table "nodes" violates foreign key constraint "nodes_nodegroups_fk"
DETAIL: Key (group_id)=(3) is not present in table "nodegroups".
 'UPDATE nodes SET group_id=%(group_id)s WHERE nodes.id = %(nodes_id)s' {'nodes_id': 1, 'group_id': 3})
[root@nailgun ~]#

API validator should be fixed to catch this situation.

Revision history for this message
Aleksey Kasatkin (alekseyk-ru) wrote :

Alexander Gubanov:

Verified on MOS 7.0 (build 257) - have some problem.
Details: http://pastebin.com/hgPBbPTa

Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
Ryan Moe (rmoe)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Ryan Moe (rmoe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

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

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/224306
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=d4a70604481351265c00a96e449df50dda3e9752
Submitter: Jenkins
Branch: master

commit d4a70604481351265c00a96e449df50dda3e9752
Author: Ryan Moe <email address hidden>
Date: Wed Sep 16 14:03:31 2015 -0700

    Validate node group exists when assigning node groups to nodes

    API validator checks for existence of a node group. In the case
    where a specified group does not exist it returns the proper status
    code and error message.

    Change-Id: I58ae9094046e5f261839ec90eaac79e639dbfb4d
    Closes-bug: #1494835

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Anastasia Palkina (apalkina) wrote :

Verified on ISO #167

"fuel-createmirror_sha": "843736e50534d184f4b07744d68d0f2d27284cae", "api": "1.0", "fuelmain_sha": "eb669555ca18b0fb372c53857f1c7b2f10e669dd", "astute_sha": "7cea69bd021d6132cde473cdd25e5142fdddad95", "fuel-ostf_sha": "618eb749d78cce075c2b14664b59a06d92f142c2", "openstack_version": "2015.1.0-8.0", "build_id": "167", "build_number": "167", "auth_required": true, "fuel-library_sha": "790fa9354d06504698d8c722316bb428a35ef9b0", "fuel-nailgun-agent_sha": "08e0a11cf1f29b705e4b910d9b9db5e9b708b6e3", "fuel-nailgun_sha": "2e948eaa0152c886f280c5f42e88500a73c75011", "fuel-agent_sha": "49e2e8a08a3cf39d1b38ee155015332aa84e47fd", "production": "docker", "python-fuelclient_sha": "3975398ea980c4ab3786c043843dfaaf97b4404a", "feature_groups": ["mirantis"], "release": "8.0", "release_versions": {"2015.1.0-8.0": {"VERSION": {"fuel-createmirror_sha": "843736e50534d184f4b07744d68d0f2d27284cae", "api": "1.0", "fuelmain_sha": "eb669555ca18b0fb372c53857f1c7b2f10e669dd", "astute_sha": "7cea69bd021d6132cde473cdd25e5142fdddad95", "fuel-ostf_sha": "618eb749d78cce075c2b14664b59a06d92f142c2", "openstack_version": "2015.1.0-8.0", "build_id": "167", "build_number": "167", "fuel-library_sha": "790fa9354d06504698d8c722316bb428a35ef9b0", "fuel-nailgun-agent_sha": "08e0a11cf1f29b705e4b910d9b9db5e9b708b6e3", "fuel-nailgun_sha": "2e948eaa0152c886f280c5f42e88500a73c75011", "fuel-agent_sha": "49e2e8a08a3cf39d1b38ee155015332aa84e47fd", "production": "docker", "python-fuelclient_sha": "3975398ea980c4ab3786c043843dfaaf97b4404a", "feature_groups": ["mirantis"], "release": "8.0"}}}

Changed in fuel:
status: Fix Committed → Fix Released
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
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.