Validator for new role should pass numbers and other symbols

Bug #1625293 reported by Alexander Kurenyshev
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Georgy Kibardin
Mitaka
Fix Released
High
Georgy Kibardin
Newton
In Progress
High
Alexey Shtokolov
Ocata
Fix Committed
High
Georgy Kibardin

Bug Description

I tried to add a new role with name fuel_plugin_example_v4, it's yaml file:
meta:
  description: description
  group: other
  name: fuel_plugin_example_v4
  weight: 70
name: fuel_plugin_example_v4
volumes_roles_mapping:
- allocate_size: min
  id: os

When I execute:
[root@nailgun ~]# fuel role --rel 2 --create --file fuel_plugin_example_v4.yaml

it fails with:
400 Client Error: Bad Request for url: http://10.109.0.2:8000/api/v1/releases/2/roles/ (u'fuel_plugin_example_v4' does not match '^[a-zA-Z_-]+$'

Failed validating 'pattern' in schema['properties']['name']:
    {'pattern': '^[a-zA-Z_-]+$', 'type': 'string'}

On instance['name']:
    u'fuel_plugin_example_v4')

Actual result:
^^
Expected result:
role added successfully

This fail is related to the plugin tests, were role consists of letters and numbers

This issue was introduced here [1]

[root@nailgun ~]# shotgun2 short-report
cat /etc/fuel_build_id:
 495
cat /etc/fuel_build_number:
 495
cat /etc/fuel_release:
 9.1
cat /etc/fuel_openstack_version:
 mitaka-9.0
rpm -qa | egrep 'fuel|astute|network-checker|nailgun|packetary|shotgun':
 python-fuelclient-9.0.0-1.mos355.noarch
 fuel-misc-9.0.0-1.mos8599.noarch
 fuel-setup-9.0.0-1.mos6356.noarch
 fuel-nailgun-9.0.0-1.mos8859.noarch
 fuelmenu-9.0.0-1.mos275.noarch
 fuel-notify-9.0.0-1.mos8599.noarch
 fuel-ui-9.0.0-1.mos2814.noarch
 shotgun-9.0.0-1.mos90.noarch
 fuel_plugin_example_v4_hotpluggable-4.0-4.0.0-1.noarch
 rubygem-astute-9.0.0-1.mos770.noarch
 fuel-provisioning-scripts-9.0.0-1.mos8859.noarch
 fuel-9.0.0-1.mos6356.noarch
 fuel-openstack-metadata-9.0.0-1.mos8859.noarch
 network-checker-9.0.0-1.mos74.x86_64
 fuel-utils-9.0.0-1.mos8599.noarch
 python-packetary-9.0.0-1.mos151.noarch
 fuel-migrate-9.0.0-1.mos8599.noarch
 nailgun-mcagents-9.0.0-1.mos770.noarch
 fuel-agent-9.0.0-1.mos291.noarch
 fuel-mirror-9.0.0-1.mos151.noarch
 fuel-bootstrap-cli-9.0.0-1.mos291.noarch
 fuel-release-9.0.0-1.mos6356.noarch
 fuel-library9.0-9.0.0-1.mos8599.noarch
 fuel-ostf-9.0.0-1.mos944.noarch

[1] https://github.com/openstack/fuel-web/commit/a3cd0ea0708e6c532bdcea0ac260c913bddd92f4

description: updated
Revision history for this message
Ilya Kutukov (ikutukov) wrote :
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

Actually you yaml file works good http://paste.openstack.org/show/581229/,
But if we change it from your example to this one:

meta:
  description: description
  group: other
  name: fuel_plugin_example_v4
  weight: 70
name: fuel_plugin_example_v4 # We add here '_v4'
volumes_roles_mapping:
- allocate_size: min
  id: os

it fails:
[root@fuel ~]# fuel role --rel 2 --create --file fuel_plugin_example_v4.yaml
400 Client Error: Bad Request for url: http://10.20.0.2:8000/api/v1/releases/2/roles/ (u'fuel_plugin_example_v4' does not match '^[a-zA-Z_-]+$'

Failed validating 'pattern' in schema['properties']['name']:
    {'pattern': '^[a-zA-Z_-]+$', 'type': 'string'}

On instance['name']:
    u'fuel_plugin_example_v4')

no longer affects: fuel/newton
tags: added: area-python
Changed in fuel:
status: New → Confirmed
Revision history for this message
Alexander Kurenyshev (akurenyshev) wrote :

@Vitalii,
sorry that was really worked example from my experiments, I will update description with yours one

description: updated
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Georgy Kibardin (gkibardin)
Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/373144

Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

Could someone add explanation why this bug is critical?

Changed in fuel:
importance: Critical → High
tags: added: release-notes
Revision history for this message
Olena Logvinova (ologvinova) wrote :
tags: added: release-notes-done
removed: release-notes
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/mitaka)

Reviewed: https://review.openstack.org/373144
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=3f2b5f651410ac92226384ebc1a28054e4804875
Submitter: Jenkins
Branch: stable/mitaka

commit 3f2b5f651410ac92226384ebc1a28054e4804875
Author: Georgy Kibardin <email address hidden>
Date: Tue Sep 20 13:31:20 2016 +0300

    Allow digits in a role name

    Change-Id: Idf66230d824ad8c81ae273593e750b51a70f892f
    Closes-Bug: #1625293

tags: added: on-verification
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/388770

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/388770
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=482d0dd424bf899f0916fe694860fb18593d906c
Submitter: Jenkins
Branch: master

commit 482d0dd424bf899f0916fe694860fb18593d906c
Author: Jenkins <email address hidden>
Date: Wed Oct 19 09:42:09 2016 +0000

    Allow digits in a role name

    Closes-Bug: #1625293
    (cherry picked from commit 3965f99696611cc2eecec18ee3a1f39eb7bb8ad1)

    Change-Id: I00c0d4474e1150b38e5df27cfdc5bc530854bcaa

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
ElenaRossokhina (esolomina) wrote :

Verified on 9.2 snapshot #414
http://paste.openstack.org/show/586658/

tags: removed: on-verification
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/396177

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/newton)

Change abandoned by Fuel DevOps Robot (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/396177
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix proposed to mos/mos-docs (master)

Related fix proposed to branch: master
Change author: Mariia Zlatkova <email address hidden>
Review: https://review.fuel-infra.org/30303

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix merged to mos/mos-docs (master)

Reviewed: https://review.fuel-infra.org/30303
Submitter: Olena Logvinova <email address hidden>
Branch: master

Commit: dc4cfe1141c0237b04d32ddea8c33b09ac0f854d
Author: Mariia Zlatkova <email address hidden>
Date: Thu Feb 2 13:50:37 2017

[RN-9.2] Fuel resolved and known issues

Change-Id: Idb919f92b981eee0f2cb48618dde243e4582ee5b
Related-Bug: #1590633
Related-Bug: #1625293
Related-Bug: #1561092
Related-Bug: #1619341
Related-Bug: #1563465
Related-Bug: #1628500
Related-Bug: #1593277
Related-Bug: #1628940
Related-Bug: #1658952

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix proposed to mos/mos-docs (stable/9.2)

Related fix proposed to branch: stable/9.2
Change author: Mariia Zlatkova <email address hidden>
Review: https://review.fuel-infra.org/30423

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix merged to mos/mos-docs (stable/9.2)

Reviewed: https://review.fuel-infra.org/30423
Submitter: Mariia Zlatkova <email address hidden>
Branch: stable/9.2

Commit: c040581a57fac1dfeaed44952359f21963216d62
Author: Mariia Zlatkova <email address hidden>
Date: Thu Feb 2 14:03:50 2017

[RN-9.2] Fuel resolved and known issues

Change-Id: Idb919f92b981eee0f2cb48618dde243e4582ee5b
Related-Bug: #1590633
Related-Bug: #1625293
Related-Bug: #1561092
Related-Bug: #1619341
Related-Bug: #1563465
Related-Bug: #1628500
Related-Bug: #1593277
Related-Bug: #1628940
Related-Bug: #1658952
(cherry picked from commit dc4cfe1141c0237b04d32ddea8c33b09ac0f854d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 11.0.0.0rc1

This issue was fixed in the openstack/fuel-web 11.0.0.0rc1 release candidate.

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.