Idenpotency is broken with nova_flavor when properties is set

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

Bug Description

When a manifest contains nova_flavor resource with "properties" property set, it always detect a change in properties even though the flavor actually has the defined properties set.

[root@localhost ~]# cat test.pp
nova_flavor { 'test':
  ensure => present,
  ram => '128',
  disk => '2',
  vcpus => '1',
  properties => {'foo' => 'bar'}
}
[root@localhost ~]# openstack flavor list --long --all
+--------------------------------------+----------+-----+------+-----------+-------+-----------+------+-------------+------------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | Swap | RXTX Factor | Properties |
+--------------------------------------+----------+-----+------+-----------+-------+-----------+------+-------------+------------+
| 1 | m1.tiny | 128 | 2 | 0 | 1 | True | 0 | 1.0 | |
| 42 | m1.nano | 128 | 2 | 0 | 1 | True | 0 | 1.0 | |
| 7c6fc833-f3a6-45cc-bc62-c04f0563951c | test | 128 | 2 | 0 | 1 | True | 0 | 1.0 | foo='bar' |
| 84 | m1.micro | 128 | 2 | 0 | 1 | True | 0 | 1.0 | |
+--------------------------------------+----------+-----+------+-----------+-------+-----------+------+-------------+------------+
[root@localhost ~]# puppet apply --modulepath /usr/share/openstack-puppet/modules/ test.pp
Notice: Compiled catalog for localhost.localdomain in environment production in 0.04 seconds
Notice: /Stage[main]/Main/Nova_flavor[test]/properties: properties changed {

} to {
  'foo' => 'bar'
}
Notice: Applied catalog in 9.21 seconds
[root@localhost ~]# openstack flavor list --long --all
+--------------------------------------+----------+-----+------+-----------+-------+-----------+------+-------------+------------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | Swap | RXTX Factor | Properties |
+--------------------------------------+----------+-----+------+-----------+-------+-----------+------+-------------+------------+
| 1 | m1.tiny | 128 | 2 | 0 | 1 | True | 0 | 1.0 | |
| 42 | m1.nano | 128 | 2 | 0 | 1 | True | 0 | 1.0 | |
| 7c6fc833-f3a6-45cc-bc62-c04f0563951c | test | 128 | 2 | 0 | 1 | True | 0 | 1.0 | foo='bar' |
| 84 | m1.micro | 128 | 2 | 0 | 1 | True | 0 | 1.0 | |
+--------------------------------------+----------+-----+------+-----------+-------+-----------+------+-------------+------------+

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

Reviewed: https://review.opendev.org/c/openstack/puppet-nova/+/914813
Committed: https://opendev.org/openstack/puppet-nova/commit/820695b463d4dead2f00834458e770c9a3c0dec4
Submitter: "Zuul (22348)"
Branch: master

commit 820695b463d4dead2f00834458e770c9a3c0dec4
Author: Takashi Kajinami <email address hidden>
Date: Tue Apr 2 00:18:03 2024 +0900

    nova_flavor: Fix broken idempotency with properties

    Make sure that nova_flavor resource is idempotent when the "properties"
    property is set. Also fix the typo causing undefined method error.

    Closes-Bug: #2059949
    Change-Id: I17a9d92c44b8dfe329b22b309d7a0408df707d1a

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

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/puppet-nova/+/914879

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

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/puppet-nova/+/915004

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

Reviewed: https://review.opendev.org/c/openstack/puppet-nova/+/914879
Committed: https://opendev.org/openstack/puppet-nova/commit/3d7de53fc44b1c4caa611056956629e30985f49d
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 3d7de53fc44b1c4caa611056956629e30985f49d
Author: Takashi Kajinami <email address hidden>
Date: Tue Apr 2 00:18:03 2024 +0900

    nova_flavor: Fix broken idempotency with properties

    Make sure that nova_flavor resource is idempotent when the "properties"
    property is set. Also fix the typo causing undefined method error.

    Closes-Bug: #2059949
    Change-Id: I17a9d92c44b8dfe329b22b309d7a0408df707d1a
    (cherry picked from commit 820695b463d4dead2f00834458e770c9a3c0dec4)

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

Reviewed: https://review.opendev.org/c/openstack/puppet-nova/+/915004
Committed: https://opendev.org/openstack/puppet-nova/commit/e7a09d24dff550a1640e69e97cea7b7dd3081df1
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit e7a09d24dff550a1640e69e97cea7b7dd3081df1
Author: Takashi Kajinami <email address hidden>
Date: Tue Apr 2 00:18:03 2024 +0900

    nova_flavor: Fix broken idempotency with properties

    Make sure that nova_flavor resource is idempotent when the "properties"
    property is set. Also fix the typo causing undefined method error.

    Closes-Bug: #2059949
    Change-Id: I17a9d92c44b8dfe329b22b309d7a0408df707d1a
    (cherry picked from commit 820695b463d4dead2f00834458e770c9a3c0dec4)
    (cherry picked from commit 3d7de53fc44b1c4caa611056956629e30985f49d)

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

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