FPB doesn't validate text_list and textarea_list properly

Bug #1616466 reported by Jerzy Mikolajczak
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Ihor Kalnytskyi
Mitaka
Confirmed
High
Fuel Sustaining

Bug Description

When using text_list or textarea_list attribute types in environment_config.yaml, FPB fails to build the plugin.

Steps to reproduce:
1) Generate a plugin
fpb --create test-plugin
2) Change environment_config.yaml to:
http://paste.openstack.org/show/562931/
3) Build the plugin
fpb --build test-plugin

Expected results:
Plugin is being built correctly

Actual result:
Plugin build failed with error:

Validation failed
File 'test-plugin/environment_config.yaml', ['server1'] is not of type 'string', 'boolean', value path 'attributes -> server-name -> value'

Passing a string value helps with plugin being built but:
1) when passing empty string:
server-name:
  value: ""

There is no input field between label and description: http://i.imgur.com/OW5DLYm.png

2) when passing a string:
server-name:
  value: "ABC"

each char of string is in separate field: http://i.imgur.com/8d6GKxZ.png

Revision history for this message
Jerzy Mikolajczak (jmikolajczak-b) wrote :

using: fuel-plugin-builder (4.1.0)

Changed in fuel:
assignee: nobody → Igor Kalnitsky (ikalnitsky)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-plugins (master)

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

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

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

commit 4cd808c39b9501b62345d1ab57f58f6b30002a68
Author: Igor Kalnitsky <email address hidden>
Date: Mon Sep 5 15:55:48 2016 +0300

    Allow arrays in 'value' in environment_config.yaml

    Since Fuel 9.0 we have a new type for environment attributes: "text_list".
    In that case, attribute's value must be an array. FPB didn't handle that
    case, and throws error for any case when value is array.

    This patch add "array" as a valid type for "value". In order to keep
    simplicity and do not overcomplicate JSON schema, it allows arrays for
    all types, not only for "text_list". It's consistent with Nailgun code,
    where we don't have such check either.

    Change-Id: I2ab401e4cdc7c1a1eb276aa71253818c688fdca1
    Closes-Bug: #1616466

Changed in fuel:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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