Deleting of assigned role is successful

Bug #1446730 reported by Alexander Kurenyshev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Dima Shulyak

Bug Description

Steps to reproduce:

1) Setup master node.
2) Create new environment with Ubuntu host OS.
3) Add node with role controller, for ex.
4) Go to the master node console
5) Try to delete role controller from release 2 (Ubuntu)

Expected behaviour:
There is an error. Node couldn't be deleted.

Actual behaviour:
Node successfully deleted.

Fuel used:
api: '1.0'
astute_sha: bf1751a4fe0d912325e3b4af629126a59c1b2b51
auth_required: true
build_id: 2015-04-21_03-06-54
build_number: '330'
feature_groups:
- mirantis
fuellib_sha: b878f1ae8e1d4c6f2f463e810b1f8014df5b22a5
fuelmain_sha: 0c0e299dcc0276bb8262256148c6ee975857ee86
nailgun_sha: 69fca3bada96a48ab19b969621e5128390b7052e
openstack_version: 2014.2-6.1
ostf_sha: df8db1f48f03b18126ce5ec65317a1eb83a5a95f
production: docker
python-fuelclient_sha: b4f1ddffd5263489090b65e662173e9e11aafd94
release: '6.1'
release_versions:
  2014.2-6.1:
    VERSION:
      api: '1.0'
      astute_sha: bf1751a4fe0d912325e3b4af629126a59c1b2b51
      build_id: 2015-04-21_03-06-54
      build_number: '330'
      feature_groups:
      - mirantis
      fuellib_sha: b878f1ae8e1d4c6f2f463e810b1f8014df5b22a5
      fuelmain_sha: 0c0e299dcc0276bb8262256148c6ee975857ee86
      nailgun_sha: 69fca3bada96a48ab19b969621e5128390b7052e
      openstack_version: 2014.2-6.1
      ostf_sha: df8db1f48f03b18126ce5ec65317a1eb83a5a95f
      production: docker
      python-fuelclient_sha: b4f1ddffd5263489090b65e662173e9e11aafd94
      release: '6.1'

Revision history for this message
Alexander Kurenyshev (akurenyshev) wrote :
Changed in fuel:
milestone: none → 6.1
Revision history for this message
Dima Shulyak (dshulyak) wrote :

Are you sure about that? I tried to delete role, and got:

  [root@nailgun ~]# fuel role --rel 1 --delete --role controller
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
400 Client Error: Bad Request (Can't delete roles that is assigned to some node.)

Changed in fuel:
status: New → Incomplete
Revision history for this message
Aleksey Kasatkin (alekseyk-ru) wrote :

Cannot reproduce also:

[root@nailgun ~]# fuel node
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
id | status | name | cluster | ip | mac | roles | pending_roles | online | group_id
---|--------|------------------|---------|------------|-------------------|-----------------|---------------|--------|---------
11 | ready | Untitled (7b:7e) | 3 | 10.109.0.3 | 64:f2:d9:6b:7b:7e | controller | | True | 3
13 | ready | Untitled (0a:34) | 3 | 10.109.0.4 | 64:46:b4:aa:0a:34 | controller | | True | 3
15 | ready | Untitled (b6:59) | 3 | 10.109.0.6 | 64:31:32:b9:b6:59 | cinder, compute | | True | 3
14 | ready | Untitled (96:88) | 3 | 10.109.0.7 | 64:aa:e3:0d:96:88 | cinder, compute | | True | 3
12 | ready | Untitled (c0:cb) | 3 | 10.109.0.5 | 64:ac:5b:92:c0:cb | controller | | True | 3

[root@nailgun ~]# fuel env
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
id | status | name | mode | release_id | changes | pending_release_id
---|-------------|---------------|------------|------------|---------|-------------------
3 | operational | TestNovaBonds | ha_compact | 1 | [] | None

[root@nailgun ~]# fuel role --rel 1 --delete --role controller
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
400 Client Error: Bad Request (Can't delete roles that is assigned to some node.)

[root@nailgun ~]# fuel rel
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
id | name | state | operating_system | version
---|------------------------|-----------|------------------|-----------
2 | Juno on Ubuntu 14.04.1 | available | Ubuntu | 2014.2-6.1
1 | Juno on CentOS 6.5 | available | CentOS | 2014.2-6.1

[root@nailgun ~]# fuel role --rel 2 --delete --role controller
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
Role with id controller successfully deleted.

It can be deleted for unused release only.

Revision history for this message
Alexander Kurenyshev (akurenyshev) wrote :

Guys, however:
[root@nailgun ~]# fuel role --rel 2 --delete --role controller
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
Role with id controller successfully deleted.
[root@nailgun ~]#

[root@nailgun ~]# fuel env
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
id | status | name | mode | release_id | changes | pending_release_id
---|--------|------|------------|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------
1 | new | test | ha_compact | 2 | [{u'node_id': None, u'name': u'attributes'}, {u'node_id': None, u'name': u'networks'}, {u'node_id': None, u'name': u'vmware_attributes'}, {u'node_id': None, u'name': u'interfaces'}, {u'node_id': None, u'name': u'disks'}] | None
[root@nailgun ~]#

[root@nailgun ~]# fuel rel
DEPRECATION WARNING: file /etc/fuel/client/config.yaml is found and will be used as a source for settings. However, it deprecated and will not be used by default in the ongoing version of python-fuelclient.
id | name | state | operating_system | version
---|------------------------|-----------|------------------|-----------
2 | Juno on Ubuntu 14.04.1 | available | Ubuntu | 2014.2-6.1
1 | Juno on CentOS 6.5 | available | CentOS | 2014.2-6.1
[root@nailgun ~]#

Revision history for this message
Alexander Kurenyshev (akurenyshev) wrote :
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
status: Incomplete → New
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/176238

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Dima Shulyak (dshulyak)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

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

commit e1b3be9c519f3271d0ee295346dd0a3fa3c23239
Author: Dmitry Shulyak <email address hidden>
Date: Wed Apr 22 12:34:56 2015 +0300

    Role with pending nodes should not be deleted

    Added verification for pending_nodes in roles validator.
    400 Bad-Request will be returned in case user will try it.

    Change-Id: Ieeb4f3233cbd1928193aa9b96efc2792d3581411
    Closes-Bug: 1446730

Changed in fuel:
status: In Progress → Fix Committed
Vasily Gorin (vgorin)
Changed in fuel:
status: Fix Committed → In Progress
Vasily Gorin (vgorin)
Changed in fuel:
status: In Progress → Fix Committed
Vasily Gorin (vgorin)
tags: added: on-verification
Revision history for this message
Vasily Gorin (vgorin) wrote :

Verified on build #338

VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "6.1"
  openstack_version: "2014.2.2-6.1"
  api: "1.0"
  build_number: "338"
  build_id: "2015-04-22_22-54-31"
  nailgun_sha: "4972120d5a5d41efe9be2d10b81329adf3258a78"
  python-fuelclient_sha: "2b311b3b82a1e2df1dc3484a0f37e282273cd988"
  astute_sha: "5be3506e6a4f8b7f0a858db2e162dabcc07347df"
  fuel-library_sha: "9b26cb98e7ceb905fe85b744eee2f808f7e4737b"
  fuel-ostf_sha: "dcda5a869d1780efc265b6f6b7b8c14c8324a68b"
  fuelmain_sha: "2f8be90209e709810674f73abb02bb54a700ce5e"

Changed in fuel:
status: Fix Committed → Fix Released
tags: removed: on-verification
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.