magnumclient not have good validation for node_count

Bug #1522668 reported by Kai Qiang Wu(Kennan)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Invalid
Undecided
Yang Hongyang

Bug Description

according to review https://review.openstack.org/#/c/252772/

 $ magnum bay-create --name k8sbay-test2 --baymodel k8sbaymodel --node-count None ERROR: Invalid input for field/attribute bay. Value: '{'name': 'k8sbay-test2', 'node_count': 'None', 'master_count': 1, 'baymodel_id': '6f5a653a-d608-4914-879b-dc20e1c27fe7', 'discovery_url': None}'. invalid literal for int() with base 10: 'None' (HTTP 400)

It is not good check, it seems move all checks in server side, I think some check can be like nova flavor-create

like this:

$ nova flavor-create dsdsd 120 None None None
ERROR (CommandError): Ram must be an integer.

we should have something like node_count must be an integer.

Changed in magnum:
assignee: nobody → Yang Hongyang (hongyang-yang)
Revision history for this message
yatin (yatinkarel) wrote :

I think it is fixed in latest version: so can be closed
ubuntu@ubuntubase:/opt/stack/devstack$ magnum bay-list
+--------------------------------------+--------+------------+--------------+--------------------+
| uuid | name | node_count | master_count | status |
+--------------------------------------+--------+------------+--------------+--------------------+
| 88349f8f-c59c-495e-8550-0b05104df208 | k8sbay | 1 | 1 | CREATE_IN_PROGRESS |
+--------------------------------------+--------+------------+--------------+--------------------+
ubuntu@ubuntubase:/opt/stack/devstack$ magnum bay-create --name k8sbay --baymodel k8sbaymodel --node-count err
usage: magnum bay-create [--name <name>] --baymodel <baymodel>
                         [--node-count <node-count>]
                         [--master-count <master-count>]
                         [--discovery-url <discovery-url>]
                         [--timeout <timeout>]
error: argument --node-count: invalid int value: u'err'
Try 'magnum help bay-create' for more information.
ubuntu@ubuntubase:/opt/stack/devstack$ magnum --version
2.1.1
ubuntu@ubuntubase:/opt/stack/devstack$ magnum bay-list
+--------------------------------------+--------+------------+--------------+--------------------+
| uuid | name | node_count | master_count | status |
+--------------------------------------+--------+------------+--------------+--------------------+
| 88349f8f-c59c-495e-8550-0b05104df208 | k8sbay | 1 | 1 | CREATE_IN_PROGRESS |
+--------------------------------------+--------+------------+--------------+--------------------+
ubuntu@ubuntubase:/opt/stack/devstack$ magnum bay-create --name k8sbay --baymodel k8sbaymodel --node-count err
usage: magnum bay-create [--name <name>] --baymodel <baymodel>
                         [--node-count <node-count>]
                         [--master-count <master-count>]
                         [--discovery-url <discovery-url>]
                         [--timeout <timeout>]
error: argument --node-count: invalid int value: u'err'
Try 'magnum help bay-create' for more information.
ubuntu@ubuntubase:/opt/stack/devstack$ magnum --version
2.1.1
ubuntu@ubuntubase:/opt/stack/devstack$ magnum-api --version
2.0.1.dev334

yatin (yatinkarel)
Changed in magnum:
status: New → Invalid
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.