vs_config is not idempotent when value is nil or empty

Bug #1987419 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-vswitch
Fix Released
High
Takashi Kajinami

Bug Description

vs_config resource is not idempotent when value is set to undef or an empty value.

[vagrant@localhost ~]$ cat test.pp

vs_config { 'other_config:foo':
  ensure => present,
  value => undef
}
[vagrant@localhost ~]$ sudo puppet apply test.pp --modulepath /usr/share/openstack-puppet/modules/
Notice: Compiled catalog for localhost.localdomain in environment production in 0.03 seconds
Notice: /Stage[main]/Main/Vs_config[other_config:foo]/ensure: created
Notice: Applied catalog in 0.09 seconds
[vagrant@localhost ~]$ sudo puppet apply test.pp --modulepath /usr/share/openstack-puppet/modules/
Notice: Compiled catalog for localhost.localdomain in environment production in 0.03 seconds
Notice: /Stage[main]/Main/Vs_config[other_config:foo]/ensure: created
Notice: Applied catalog in 0.06 seconds

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

Reviewed: https://review.opendev.org/c/openstack/puppet-vswitch/+/854241
Committed: https://opendev.org/openstack/puppet-vswitch/commit/10202ad22f70cbdf00401ff065f857edb500cc57
Submitter: "Zuul (22348)"
Branch: master

commit 10202ad22f70cbdf00401ff065f857edb500cc57
Author: Takashi Kajinami <email address hidden>
Date: Wed Aug 24 01:14:17 2022 +0900

    vs_config: Fix broken idempotency with nil/empty value

    If the value is nil or empty then the option should NOT exist. This
    change fixes the logic to determine whether the option already exists
    which is causing broken idempotency.

    Closes-Bug: #1987419
    Change-Id: I56f85ca35f8e9ee4e5e8d07c714b65f655b1e9ae

Changed in puppet-vswitch:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-vswitch (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/puppet-vswitch/+/854893

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-vswitch (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/puppet-vswitch/+/854893
Committed: https://opendev.org/openstack/puppet-vswitch/commit/f659ea896e330462ab880b73a0aefea7cb5ded52
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit f659ea896e330462ab880b73a0aefea7cb5ded52
Author: Takashi Kajinami <email address hidden>
Date: Wed Aug 24 01:14:17 2022 +0900

    vs_config: Fix broken idempotency with nil/empty value

    If the value is nil or empty then the option should NOT exist. This
    change fixes the logic to determine whether the option already exists
    which is causing broken idempotency.

    Closes-Bug: #1987419
    Change-Id: I56f85ca35f8e9ee4e5e8d07c714b65f655b1e9ae
    (cherry picked from commit 10202ad22f70cbdf00401ff065f857edb500cc57)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-vswitch (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/puppet-vswitch/+/854998

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-vswitch (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/puppet-vswitch/+/855002

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-vswitch (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/puppet-vswitch/+/854998
Committed: https://opendev.org/openstack/puppet-vswitch/commit/d8d7339ff122f947a176db2b41160edbfdb65bf0
Submitter: "Zuul (22348)"
Branch: stable/xena

commit d8d7339ff122f947a176db2b41160edbfdb65bf0
Author: Takashi Kajinami <email address hidden>
Date: Wed Aug 24 01:14:17 2022 +0900

    vs_config: Fix broken idempotency with nil/empty value

    If the value is nil or empty then the option should NOT exist. This
    change fixes the logic to determine whether the option already exists
    which is causing broken idempotency.

    Closes-Bug: #1987419
    Change-Id: I56f85ca35f8e9ee4e5e8d07c714b65f655b1e9ae
    (cherry picked from commit 10202ad22f70cbdf00401ff065f857edb500cc57)
    (cherry picked from commit f659ea896e330462ab880b73a0aefea7cb5ded52)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-vswitch (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/puppet-vswitch/+/855002
Committed: https://opendev.org/openstack/puppet-vswitch/commit/33df2d222b7c9725eb49a195db606a765964d305
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 33df2d222b7c9725eb49a195db606a765964d305
Author: Takashi Kajinami <email address hidden>
Date: Wed Aug 24 01:14:17 2022 +0900

    vs_config: Fix broken idempotency with nil/empty value

    If the value is nil or empty then the option should NOT exist. This
    change fixes the logic to determine whether the option already exists
    which is causing broken idempotency.

    Closes-Bug: #1987419
    Change-Id: I56f85ca35f8e9ee4e5e8d07c714b65f655b1e9ae
    (cherry picked from commit 10202ad22f70cbdf00401ff065f857edb500cc57)
    (cherry picked from commit f659ea896e330462ab880b73a0aefea7cb5ded52)
    (cherry picked from commit d8d7339ff122f947a176db2b41160edbfdb65bf0)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-vswitch 17.0.0

This issue was fixed in the openstack/puppet-vswitch 17.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-vswitch 14.4.2

This issue was fixed in the openstack/puppet-vswitch 14.4.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-vswitch 15.4.1

This issue was fixed in the openstack/puppet-vswitch 15.4.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-vswitch 16.3.1

This issue was fixed in the openstack/puppet-vswitch 16.3.1 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.