Code refactor for OpenStack resources validation in Baymodel

Bug #1522060 reported by HouMing Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Committed
Undecided
HouMing Wang

Bug Description

A new magnum.api.attr_validator.py module is introduced to do the validation towards OpenStack resources in Bay-Creation. But currently in Baymodel-creation, the validation logic is not unified and clear. We should refactor this part, to unify the validation experience both in Bay and Baymodel, and reduce the duplicated code.

For example, the following 3 methods, which do the OpenStack resources validation should be replaced with related methods in magnum.api.attr_validator.py:

magnum.api.controllers.v1.utils.get_openstack_resource
magnum.api.controllers.v1.baymodel.BayModelsController._get_image_data
magnum.api.controllers.v1.baymodel.BayModelsController.check_keypair_exists

Changed in magnum:
assignee: nobody → Hou Ming Wang (houming-wang)
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/254615

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

Reviewed: https://review.openstack.org/254615
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=743ff7526ef36193cc58ba4e9886bb7bf5a77818
Submitter: Jenkins
Branch: master

commit 743ff7526ef36193cc58ba4e9886bb7bf5a77818
Author: houming-wang <email address hidden>
Date: Tue Dec 8 03:30:58 2015 -0500

    Refactor keypair existence check in Baymodel

    A new magnum.api.attr_validator.py module is introduced to do the
    validation towards OpenStack resources. Currently in Baymodel-creation,
    the keypair validation code is duplicated. We should reduce the
    duplicated code and unify the validation both in Bay and Baymodel.

    Change-Id: Iba1bfad00c97f90d28501e65b73eed33be05e40f
    Partial-Bug: #1522060

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/254784

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

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

commit a9dc34257841e402c6e9982764135175f84b4c8a
Author: houming-wang <email address hidden>
Date: Tue Dec 8 09:30:07 2015 -0500

    Refactor image check in Baymodel

    A new magnum.api.attr_validator.py module is introduced to do the
    validation towards OpenStack resources. Currently in Baymodel-creation,
    the image validation code is duplicated. We should reduce the
    duplicated code and unify the validation both in Bay and Baymodel.

    Change-Id: I8517024c77c6dc4082bf2ff6d0205d86e32fbfdc
    Partial-Bug: #1522060

Changed in magnum:
status: In Progress → Fix Committed
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.