Define constants for connector factory protocol

Bug #1479355 reported by Matt Riedemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Fix Released
Undecided
Ryan Rossiter

Bug Description

While reviewing the os-brick integration change in nova:

https://review.openstack.org/#/c/175569/

I brought up that it would be better to specify a constant for the protocol parameter passed from nova to os-brick's InitiatorConnector.factory method:

http://git.openstack.org/cgit/openstack/os-brick/tree/os_brick/initiator/connector.py?id=0.3.2#n134

The values passed in to os-brick right now are hard-coded. The code is case insensitive, which is good, but we should go a step further and have constants defined in os-brick that we can then use in nova and cinder so we don't have to hard-code the values.

Long-term it might be nicer yet to define enums using the enum field types in oslo.versionedobjects, but since os-brick isn't using o.vo yet that's a bit much for this short-term bug to add constants.

Matt Riedemann (mriedem)
Changed in os-brick:
status: New → Confirmed
Cale Rath (ctrath)
Changed in os-brick:
assignee: nobody → Cale Rath (ctrath)
Cale Rath (ctrath)
Changed in os-brick:
assignee: Cale Rath (ctrath) → nobody
Revision history for this message
Matt Riedemann (mriedem) wrote :
Ryan Rossiter (rlrossit)
Changed in os-brick:
assignee: nobody → Ryan Rossiter (rlrossit)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (master)

Reviewed: https://review.openstack.org/207090
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=e9d3912c060aa80fee7c290432cb252096d76cce
Submitter: Jenkins
Branch: master

commit e9d3912c060aa80fee7c290432cb252096d76cce
Author: Ryan Rossiter <email address hidden>
Date: Wed Jul 29 15:14:14 2015 +0000

    Changed connector protocols to use constants

    Originally the protocols in the connector factory method were checked
    against strings. This change moves those strings out as constants and
    now compares against the constants.

    These constants will be used by nova and cinder so the protocol values
    aren't hard-coded when being used with os-brick.

    Change-Id: I0942c352a8d46fc29565e9555f97f8e9d86cda36
    Closes-Bug: #1479355

Changed in os-brick:
status: In Progress → Fix Committed
Changed in os-brick:
milestone: none → 0.4.0
status: Fix Committed → Fix Released
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.