Could not set "conflicts" parameter to everyone at node_roles.yaml

Bug #1547590 reported by Dmitriy Stremkovskiy on 2016-02-19
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Medium
Fuel Python (Deprecated)

Bug Description

steps to reproduce

1) configure plugin
# cat node_roles.yaml:
lcm:
  name: "LCM - controller"
  description: "Install LCM controller"
  has_primary: true # whether has primary role or not
  public_ip_required: false # whether requires public net or not
  weight: 1000 # weight that will be used for ordering on fuel ui
  conflicts:
    - '*'

or:
# cat node_roles.yaml:
lcm:
  name: "LCM - controller"
  description: "Install LCM controller"
  has_primary: true # whether has primary role or not
  public_ip_required: false # whether requires public net or not
  weight: 1000 # weight that will be used for ordering on fuel ui
  conflicts: ['*']

2) configure plugin metadata
# cat metadata.yaml
# Plugin name
name: fuel-plugin-lcm
# Human-readable name for your plugin
title: LCM plugin for Fuel
# Plugin version
version: '1.0.0'
# Description
description: Enables LCM component for deployed MOS cloud (via fuel-library)
# Required fuel version
fuel_version: ['7.0','9.0']
# Specify license of your plugin
licenses: ['Apache License Version 2.0']
# Specify author or company name
authors: ['Mirantis Inc.']
# A link to the plugin's page
homepage: 'https://github.com/stackforge/fuel-plugins'
# Specify a group which your plugin implements, possible options:
# network, storage, storage::cinder, storage::glance, hypervisor
groups: []

# The plugin is compatible with releases in the list
releases:
  - os: ubuntu
    version: 2015.1.0-7.0
    mode: ['ha']
    deployment_scripts_path: deployment_scripts/
    repository_path: repositories/ubuntu
  - os: ubuntu
    version: liberty-9.0
    mode: ['ha']
    deployment_scripts_path: deployment_scripts/
    repository_path: repositories/ubuntu

# Version of plugin package
package_version: '3.0.0'

3) build plugin with one of congurations above.

actual result
Nothing of above locks role alone. I am able to assign new role (lcm) to other members.

expected
Could not assign new role to other members.

workaround
build plugin with
lcm:
  conflicts: ['*']
install it
edit /var/www/nailgun/plugins/fuel-plugin-lcm-${ver}/node_roles.yaml:
set it to
  conflicts: '*'
fuel plugins --sync

create new environment, enable plugin, now role locked alone

tags: added: area-plugins
Dmitry Klenov (dklenov) on 2016-02-20
Changed in fuel:
milestone: none → 9.0
assignee: nobody → Fuel Python Team (fuel-python)
importance: Undecided → Medium
Dmitry Klenov (dklenov) wrote :

Setting to incomplete.

@Dmitriy, please add a bit more details to the description. What is your use case? Why cannot you just list other roles?

Changed in fuel:
status: New → Incomplete

Suppose, you want to deploy multiple plugins. Every plugin requires own role you don't know. So I cannot list them and "blacklist".

Dmitry Pyzhov (dpyzhov) on 2016-03-18
tags: added: area-python feature-plugins
removed: area-plugins
Dmitry Klenov (dklenov) on 2016-03-22
Changed in fuel:
status: Incomplete → Confirmed

lcm:
  name: "LCM - controller"
  description: "Install LCM controller"
  has_primary: true # whether has primary role or not
  public_ip_required: false # whether requires public net or not
  weight: 1000 # weight that will be used for ordering on fuel ui
  conflicts: '*'

can you try this? Use just '*'.

(This check performed automatically)
Please, make sure that bug description contains the following sections filled in with the appropriate data related to the bug you are describing:

actual result

version

steps to reproduce

For more detailed information on the contents of each of the listed sections see https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Here_is_how_you_file_a_bug

tags: added: need-info

root@99bc5309a8d1:~/lcm-plugin# fpb --build .
Validation failed
File './node_roles.yaml', '*' is not of type 'array', value path 'lcm -> conflicts'

root@99bc5309a8d1:~/lcm-plugin# grep vers metadata.yaml
# Plugin version
version: '1.0.0'
# Required fuel version
fuel_version: ['7.0','9.0']
    version: 2015.1.0-7.0
    version: liberty-9.0
package_version: '3.0.0'

description: updated
description: updated
tags: removed: need-info

I've added workaround section in description

description: updated

Reviewed: https://review.openstack.org/299894
Committed: https://git.openstack.org/cgit/openstack/fuel-plugins/commit/?id=a6f3a6a3fdf7854458e248896841010a3eecfb41
Submitter: Jenkins
Branch: master

commit a6f3a6a3fdf7854458e248896841010a3eecfb41
Author: Andriy Popovych <email address hidden>
Date: Thu Mar 31 14:45:24 2016 +0300

    Add ability for role to conflict with all roles

    To support conflict of some node role with other roles '*' symbol is used.
    This patch provides fix in validation for such situation.

    Change-Id: If0123dbb05df0eddb071527990417ebafe300c93
    Related Bug: #1547590

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Andriy Popovych (popovych-andrey)
status: Confirmed → Fix Committed
assignee: Andriy Popovych (popovych-andrey) → Fuel Python Team (fuel-python)
Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers