object-ids in config options are case sensitive

Bug #1663369 reported by Andreas Scheuring on 2017-02-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-dpm
Medium
Andreas Scheuring
nova-dpm
Low
Andreas Scheuring
os-dpm
Undecided
Andreas Scheuring

Bug Description

The object-ids given in the adapter_mapping config options and the cpc_object_id config option are case sensitive. This is error prone.

Ideally the code would convert everything to lower case (this is what the HMC uses).

tags: added: ocata-rc-potential
Changed in networking-dpm:
status: New → Triaged
importance: Undecided → Medium

Doesn't block the Ocata release. I'm torn with the importance (low vs medium).

tags: added: ocata-backport-potential
removed: ocata-rc-potential
Changed in nova-dpm:
importance: Undecided → Low
Changed in networking-dpm:
assignee: nobody → Andreas Scheuring (andreas-scheuring)

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

Changed in networking-dpm:
status: Triaged → In Progress
Changed in os-dpm:
assignee: nobody → Andreas Scheuring (andreas-scheuring)
summary: - adapter_mappings config option is case sensitive
+ object-ids in config options are case sensitive
description: updated

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

Changed in os-dpm:
status: New → In Progress
Changed in nova-dpm:
assignee: nobody → Andreas Scheuring (andreas-scheuring)

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

Changed in nova-dpm:
status: New → In Progress

Change abandoned by Andreas Scheuring (<email address hidden>) on branch: master
Review: https://review.openstack.org/442509
Reason: will use a customized oslo config option instead..

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

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

Reviewed: https://review.openstack.org/443614
Committed: https://git.openstack.org/cgit/openstack/networking-dpm/commit/?id=fe8bc65fa6de67c67d7895940692a3af749c8e2f
Submitter: Jenkins
Branch: master

commit fe8bc65fa6de67c67d7895940692a3af749c8e2f
Author: Andreas Scheuring <email address hidden>
Date: Wed Mar 8 17:15:30 2017 +0100

    Move config options to networking_dpm.conf

    This patch moves the config option definition to networking_dpm.conf.
    This is the same directory like used in nova. A separate directory
    is required anyhow to have a place for custom oslo config types and
    opts.

    Change-Id: Ie0424c2287fcda1e90b1edb733d0d95245497e38
    Partial-Bug: #1663369

Change abandoned by Andreas Scheuring (<email address hidden>) on branch: master
Review: https://review.openstack.org/445835
Reason: duplicate - I forgot to update the commit message during merge...

Reviewed: https://review.openstack.org/443615
Committed: https://git.openstack.org/cgit/openstack/networking-dpm/commit/?id=52b5f3600d9c2c287c3554d954d676325fb64dfb
Submitter: Jenkins
Branch: master

commit 52b5f3600d9c2c287c3554d954d676325fb64dfb
Author: Andreas Scheuring <email address hidden>
Date: Thu Mar 9 13:15:23 2017 +0100

    Introduce oslo config object for adapter_mapping

    This patch introduces a oslo config object for a network adapter port
    mapping. It encapsulates the validation of the config value and does
    the parsing. It's a multi value config option.

    It requires the following arguments

    * name: The name of the config option.

    The config value must be of the following format in the config file

      <name>=<physnet>:<adapter-id>:<port>
      <name>=>physnet>:<adapter-id>:
      <name>=>physnet>:<adapter-id>
      # (multi valued)

    It returns a list of tuples:

      [(<physnet>, <adapter-id>, <port>),
       (<physnet>, <adapter-id>, <port>),
       (<physnet>, <adapter-id>, <port>)]

    where

    * physnet: The physical network string. Can not be 'None'.
                  No restriction in length. Keeps case from config file.
    * adapter-id: The object-id of the adapter that should be used.
                  Cannot be 'None'. Will be returned in lower case.
    * port: The port-element-id string to be used. Defaults to '0'.
                  Cannot be 'None'

    Change-Id: I407bda2896d667ef6fad4138a9787da4b39a19f7
    Partial-Bug: #1663369
    Partial-Bug: #1659315

Reviewed: https://review.openstack.org/443616
Committed: https://git.openstack.org/cgit/openstack/networking-dpm/commit/?id=bac784f9028b72a9cc0b982690df754ba5ebe34b
Submitter: Jenkins
Branch: master

commit bac784f9028b72a9cc0b982690df754ba5ebe34b
Author: Andreas Scheuring <email address hidden>
Date: Thu Mar 9 14:00:05 2017 +0100

    Use oslo config for physical_network_adapter_map

    Use the newly added oslo config opt [1] for the
    'physical_network_adapter_mappings' configuration option.

    The new config option does all the validation. It also ensures that
    the port-element-id defaults to 0 if none is given. The corresponding
    code is getting removed.

    [1] https://review.openstack.org/443615

    Change-Id: I5a1bd27fdb10579ac4e85bc502a364f2521bd162
    Closes-Bug: #1659315
    Closes-Bug: #1663369

Changed in networking-dpm:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/443193
Committed: https://git.openstack.org/cgit/openstack/nova-dpm/commit/?id=6f3261499c9d9cad6ec974ac2c354df2f9e77ffd
Submitter: Jenkins
Branch: master

commit 6f3261499c9d9cad6ec974ac2c354df2f9e77ffd
Author: Andreas Scheuring <email address hidden>
Date: Wed Mar 8 16:45:49 2017 +0100

    Introduce storage adapter mapping conf object

    This patch introduces a oslo config object that can be used by the
    physical_storage_adapter_mappings configuration option.

    The config object validates the config option along a regex and
    returns a tuple (adapter_id, port).

    It accepts adapter-ids in upper and lower case. But for users
    it returns the adapter-id always in lower case (like desired
    by the HMC web services API).

    Some parts of this code can be removed once they are available
    in a new os-dpm release (e.g. the MultiStringWithKwargsType).

    Change-Id: I03319412ad15c608ecc43b0421f0cae42bd6b5dc
    Partial-Bug: #1663369

Reviewed: https://review.openstack.org/443664
Committed: https://git.openstack.org/cgit/openstack/nova-dpm/commit/?id=cacafd8819cc492995e010dc35f0a8c3729c2915
Submitter: Jenkins
Branch: master

commit cacafd8819cc492995e010dc35f0a8c3729c2915
Author: Andreas Scheuring <email address hidden>
Date: Thu Mar 9 15:12:09 2017 +0100

    Use oslo opt for storage_adapter_mappings

    Use the oslo config opt object for the
    'physical_storage_adapter_mappings' configuration option. This configuration
    option returns a list of tuples:

      [(adapter-id, port-id), (adapter-id, port-id)]

    In addition it validates if the adapter-id is of the right format. If
    provided in upper case, it will convert it to lower case (HMC web
    services API requires lower case). The config option does not check
    if an object with this ID exists on the HMC.

    Also the port value is verified. Valid values are '0', '1', '2', '3'.

    adapter-id and port can never be 'None'.

    The usage of parse_config_line will be replaced by this config
    option.

    Change-Id: Ica7928e1eded0350dcc708eed932e9b7a5401bfc
    Partial-Bug: #1663369

Reviewed: https://review.openstack.org/443022
Committed: https://git.openstack.org/cgit/openstack/os-dpm/commit/?id=5e74551f60115684f24c62fc3695dc48d6d7281e
Submitter: Jenkins
Branch: master

commit 5e74551f60115684f24c62fc3695dc48d6d7281e
Author: Andreas Scheuring <email address hidden>
Date: Wed Mar 8 09:49:12 2017 +0100

    Validation for cpc_object_id config option

    This patch uses the newly created DPMObjectId config object to
    introduce validation for the cpc_object_id config option.

    The config option still accepts both, upper and lower case, but
    takes care of converting that value to lower case when used in the
    code. The HMC web services only supports lower case object-ids.

    Change-Id: I63bd5cdc699bde64151a7bf047e1349a7f509f3f
    Closes-Bug: #1663369

Changed in os-dpm:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers