os-net-config -i <interface> shows invalid json

Bug #1973566 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-net-config
Fix Released
Critical
Takashi Kajinami

Bug Description

The os-net-config cli provides the -i option which allows users to identify the real interface for a nic name.
However this command shows invalid json data which can't be parsed by general tooling like jq.

~~~
$ os-net-config -i nic1 | jq .
parse error: Invalid numeric literal at line 1, column 8
~~~

The issue is caused by usage of single quotes(') instead of double quotes(").

~~~
$ os-net-config -i nic1
{'nic1': 'eth0'}
~~~

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-net-config (master)
Changed in os-net-config:
status: New → In Progress
Changed in os-net-config:
importance: Undecided → Critical
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-net-config (master)

Reviewed: https://review.opendev.org/c/openstack/os-net-config/+/841830
Committed: https://opendev.org/openstack/os-net-config/commit/88a4c885f6feec08209aebbb859f34957b952b26
Submitter: "Zuul (22348)"
Branch: master

commit 88a4c885f6feec08209aebbb859f34957b952b26
Author: Takashi Kajinami <email address hidden>
Date: Mon May 16 13:03:09 2022 +0900

    Format json output properly

    str(dict) or print(dict) format a dict value into an invalid json
    string because it uses single quotes(') instead of double quotes(").

    This also fixes the log messages which mentions 'JSON' but doesn't
    convert a dict value to a valid json string.

    Closes-Bug: #1973566
    Change-Id: I2398e3881310746f349e2c9a89c64956efbc13b2

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/os-net-config/+/843390

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-net-config (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/os-net-config/+/843384

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-net-config (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/os-net-config/+/843385

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

Reviewed: https://review.opendev.org/c/openstack/os-net-config/+/843390
Committed: https://opendev.org/openstack/os-net-config/commit/bf263b66fb47f90892eb8e347322f5cf3808edb1
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit bf263b66fb47f90892eb8e347322f5cf3808edb1
Author: Takashi Kajinami <email address hidden>
Date: Mon May 16 13:03:09 2022 +0900

    Format json output properly

    str(dict) or print(dict) format a dict value into an invalid json
    string because it uses single quotes(') instead of double quotes(").

    This also fixes the log messages which mentions 'JSON' but doesn't
    convert a dict value to a valid json string.

    Closes-Bug: #1973566
    Change-Id: I2398e3881310746f349e2c9a89c64956efbc13b2
    (cherry picked from commit 88a4c885f6feec08209aebbb859f34957b952b26)

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

Reviewed: https://review.opendev.org/c/openstack/os-net-config/+/843384
Committed: https://opendev.org/openstack/os-net-config/commit/1fda18fbf0ea74234d8b68a2314a01491f45212d
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 1fda18fbf0ea74234d8b68a2314a01491f45212d
Author: Takashi Kajinami <email address hidden>
Date: Mon May 16 13:03:09 2022 +0900

    Format json output properly

    str(dict) or print(dict) format a dict value into an invalid json
    string because it uses single quotes(') instead of double quotes(").

    This also fixes the log messages which mentions 'JSON' but doesn't
    convert a dict value to a valid json string.

    Conflicts:
            os_net_config/cli.py

    Resolved conflict caused by da3bd5fbb8818743b96d7975f81907ed07409688 .

    Closes-Bug: #1973566
    Change-Id: I2398e3881310746f349e2c9a89c64956efbc13b2
    (cherry picked from commit 88a4c885f6feec08209aebbb859f34957b952b26)
    (cherry picked from commit bf263b66fb47f90892eb8e347322f5cf3808edb1)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-net-config victoria-eol

This issue was fixed in the openstack/os-net-config victoria-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-net-config (stable/train)

Reviewed: https://review.opendev.org/c/openstack/os-net-config/+/843385
Committed: https://opendev.org/openstack/os-net-config/commit/357c19afd5ef774f2488c152f3c42ae1346fa372
Submitter: "Zuul (22348)"
Branch: stable/train

commit 357c19afd5ef774f2488c152f3c42ae1346fa372
Author: Takashi Kajinami <email address hidden>
Date: Mon May 16 13:03:09 2022 +0900

    Format json output properly

    str(dict) or print(dict) format a dict value into an invalid json
    string because it uses single quotes(') instead of double quotes(").

    This also fixes the log messages which mentions 'JSON' but doesn't
    convert a dict value to a valid json string.

    Conflicts:
            os_net_config/cli.py

    Resolved conflict caused by da3bd5fbb8818743b96d7975f81907ed07409688 .

    Closes-Bug: #1973566
    Change-Id: I2398e3881310746f349e2c9a89c64956efbc13b2
    (cherry picked from commit 88a4c885f6feec08209aebbb859f34957b952b26)
    (cherry picked from commit bf263b66fb47f90892eb8e347322f5cf3808edb1)
    (cherry picked from commit 1fda18fbf0ea74234d8b68a2314a01491f45212d)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-net-config 16.0.0

This issue was fixed in the openstack/os-net-config 16.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-net-config train-eol

This issue was fixed in the openstack/os-net-config train-eol release.

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.