Restrict values only to allowed in cluster template

Bug #1622432 reported by yatin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Low
yatin

Bug Description

Currently Generic values are allowed for some of the parameters in baymodel/cluster template but these do not work:-
server_type is set to StingType as follows:
server_type = wsme.wsattr(wtypes.StringType(min_length=1,
                                                max_length=255),
                              default='vm')

1) It should be Enum('vm', 'bm') : vm for virtual machine and bm for baremetal.

2) Also api validation should be set for this so that user get proper error message if they tries to set server_type apart from allowed types('vm','bm').

Other info: There are other parameters like: volume_driver/network_driver which are set to StringType but they are validated at the time of creation.
So changing Type of these parameter to Enum doesn't seem to be required because with time volume_driver/network_driver can evolve to newly supported driver so api validation is enough.

yatin (yatinkarel)
Changed in magnum:
assignee: nobody → yatin (yatinkarel)
yatin (yatinkarel)
Changed in magnum:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

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

Changed in magnum:
importance: Undecided → Low
milestone: none → netwon-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/369145
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=745188b5efa5d95bad3a2cc17f90d44118d62436
Submitter: Jenkins
Branch: master

commit 745188b5efa5d95bad3a2cc17f90d44118d62436
Author: yatin <email address hidden>
Date: Tue Sep 13 09:58:36 2016 +0530

    Restrict server type only to vm/bm

    Currently server type can be set to any String, but it should
    be restricted to only allowed types: vm/bm.
    vm: virtual machine
    bm: baremetal
    With this patch it is restricted only to allowed types.

    Change-Id: Ifbeff8621b26702e54ad088195fddcb7c35424b2
    Closes-Bug: #1622432

Changed in magnum:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 4.0.0

This issue was fixed in the openstack/magnum 4.0.0 release.

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.