The HostDomain type is not importable

Bug #1924283 reported by Herve Beraud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.config
Fix Released
Undecided
Herve Beraud

Bug Description

When I try to use the HostDomain type by try to define a new config option based on it I obtain
the following exception:

AttributeError: module 'oslo_config.cfg' has no attribute 'HostDomain'

This type can't imported because no related config class have been defined in `oslo_config/cfg.py`
like did with other options [1].

https://opendev.org/openstack/oslo.config/src/branch/master/oslo_config/cfg.py

Changed in oslo.config:
assignee: nobody → Herve Beraud (herveberaud)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)
Changed in oslo.config:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.opendev.org/c/openstack/oslo.config/+/786394
Committed: https://opendev.org/openstack/oslo.config/commit/bb5e4cbeb973c6341bf51eea2ebe5d38366167e8
Submitter: "Zuul (22348)"
Branch: master

commit bb5e4cbeb973c6341bf51eea2ebe5d38366167e8
Author: Hervé Beraud <email address hidden>
Date: Thu Apr 15 13:44:42 2021 +0200

    Adding the missing HostDomain config option

    The ``HostDomain`` config type have been added few months ago [1]
    however the config option have been forgotten and this new type
    isn't importable.

    When we try to import this type without defining a new related cfg
    option we get the following issue:

    ```
    AttributeError: module 'oslo_config.cfg' has no attribute 'HostDomain'
    ```

    These changes allow us to import this new type and allow us to use
    it in our configs:

    ```
    >>> from oslo_config import cfg
    >>> foo = cfg.HostDomain('foo')
    >>> foo.type.__call__("1")
    ...
    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "~/oslo.config/oslo_config/types.py", line 893, in __call__
         raise ValueError(
    ValueError: 1 is not a valid host address
    >>> foo.type.__call__("host_name")
    'host_name'
    ```

    Also properly initialize HostDomain because The HostDomain class wasn't
    calling super in it's __init__() method, which resulted in the type_name not
    being set properly for instances of that class.

    [1] https://opendev.org/openstack/oslo.config/commit/6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75

    Change-Id: Ie947803f61ba0ef080018e0447de894a400d7975
    Closes-Bug: 1924283

Changed in oslo.config:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/oslo.config/+/788229

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.config 8.6.0

This issue was fixed in the openstack/oslo.config 8.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/oslo.config/+/788229
Committed: https://opendev.org/openstack/oslo.config/commit/1074937e84a5d2b8f356260d4cc54497ee95cfe8
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 1074937e84a5d2b8f356260d4cc54497ee95cfe8
Author: Hervé Beraud <email address hidden>
Date: Thu Apr 15 13:44:42 2021 +0200

    Adding the missing HostDomain config option

    The ``HostDomain`` config type have been added few months ago [1]
    however the config option have been forgotten and this new type
    isn't importable.

    When we try to import this type without defining a new related cfg
    option we get the following issue:

    ```
    AttributeError: module 'oslo_config.cfg' has no attribute 'HostDomain'
    ```

    These changes allow us to import this new type and allow us to use
    it in our configs:

    ```
    >>> from oslo_config import cfg
    >>> foo = cfg.HostDomain('foo')
    >>> foo.type.__call__("1")
    ...
    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "~/oslo.config/oslo_config/types.py", line 893, in __call__
         raise ValueError(
    ValueError: 1 is not a valid host address
    >>> foo.type.__call__("host_name")
    'host_name'
    ```

    Also properly initialize HostDomain because The HostDomain class wasn't
    calling super in it's __init__() method, which resulted in the type_name not
    being set properly for instances of that class.

    [1] https://opendev.org/openstack/oslo.config/commit/6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75

    Change-Id: Ie947803f61ba0ef080018e0447de894a400d7975
    Closes-Bug: 1924283
    (cherry picked from commit bb5e4cbeb973c6341bf51eea2ebe5d38366167e8)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/oslo.config/+/790610

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/oslo.config/+/790610
Committed: https://opendev.org/openstack/oslo.config/commit/dca54e4c1cf3c4d2674d146678fe08c021977358
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit dca54e4c1cf3c4d2674d146678fe08c021977358
Author: Hervé Beraud <email address hidden>
Date: Thu Apr 15 13:44:42 2021 +0200

    Adding the missing HostDomain config option

    The ``HostDomain`` config type have been added few months ago [1]
    however the config option have been forgotten and this new type
    isn't importable.

    When we try to import this type without defining a new related cfg
    option we get the following issue:

    ```
    AttributeError: module 'oslo_config.cfg' has no attribute 'HostDomain'
    ```

    These changes allow us to import this new type and allow us to use
    it in our configs:

    ```
    >>> from oslo_config import cfg
    >>> foo = cfg.HostDomain('foo')
    >>> foo.type.__call__("1")
    ...
    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "~/oslo.config/oslo_config/types.py", line 893, in __call__
         raise ValueError(
    ValueError: 1 is not a valid host address
    >>> foo.type.__call__("host_name")
    'host_name'
    ```

    Also properly initialize HostDomain because The HostDomain class wasn't
    calling super in it's __init__() method, which resulted in the type_name not
    being set properly for instances of that class.

    [1] https://opendev.org/openstack/oslo.config/commit/6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75

    Change-Id: Ie947803f61ba0ef080018e0447de894a400d7975
    Closes-Bug: 1924283
    (cherry picked from commit 1074937e84a5d2b8f356260d4cc54497ee95cfe8)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/oslo.config/+/793933

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.config 8.5.1

This issue was fixed in the openstack/oslo.config 8.5.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.config 8.3.4

This issue was fixed in the openstack/oslo.config 8.3.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.config (stable/ussuri)

Change abandoned by "Stephen Finucane <email address hidden>" on branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/oslo.config/+/793933
Reason: This branch is going into extended maintenance soon so I don't think we should be backporting this feature-like change. I'm going to abandon it. If anyone disagrees, please let me know and we can restore it.

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.