tripleo_network_config role _always_ runs despite stack_action: UPDATE and network_deployment_actions: [CREATE]

Bug #1918372 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Harald Jensås

Bug Description

The condition to check if network config should be applied always end up applying config.

  # The conditions here are when we want to apply the
  # NetworkConfig. They are:
  # - If the stack_action is CREATE
  # - Or UPDATE is in the network_deployment_actions
  # - Or the previous run of NetworkConfig failed.
  # - Or it has never run
  # This will match the prior behavior of when a Heat
  # SoftwareDeployment was used.
  # It also ensures the script does exist as a sine qua non
  # condition
  when:
    - (tripleo_network_config_action == "CREATE") or
      ("UPDATE" in tripleo_network_config_network_deployment_actions) or
      (os_net_config_returncode_stat.stat.exists and
      ((os_net_config_returncode_slurp.content | b64decode ) != 0)) or
       (not os_net_config_returncode_stat.stat.exists)

The problem is:
  ((os_net_config_returncode_slurp.content | b64decode ) != 0))

It needs to be:
  ((os_net_config_returncode_slurp.content | b64decode | int) != 0))

It seems it's comparing:
r��z{L\u0002�.�ǿ����&������\u001c�w��,��\\�w₷���ܡמ��\u001d�x\u001bjǺ�����Ej[\u001er\u0016���Ej[\u001e != 0

Revision history for this message
Harald Jensås (harald-jensas) wrote :
tags: added: victoria-backport-potential
Changed in tripleo:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 3.1.0

This issue was fixed in the openstack/tripleo-ansible 3.1.0 release.

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

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/tripleo-ansible/+/792031

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/tripleo-ansible/+/792032

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/tripleo-ansible/+/792033

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/tripleo-ansible/+/792032
Committed: https://opendev.org/openstack/tripleo-ansible/commit/5b3f9bc96050fb1c34a19629604e2844ee3446f4
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 5b3f9bc96050fb1c34a19629604e2844ee3446f4
Author: Harald Jensås <email address hidden>
Date: Wed Mar 10 05:27:52 2021 +0100

    Fix tripleo_network config conditional

    The conditional used in the NetworkConfig block always
    evaluates to conclude that network config should be
    applied.

    Use | int filter on the slurped os-net-config return
    code file so that the condition does not always evaluate
    to False.

    Conflicts:
      tripleo_ansible/roles/tripleo_network_config/molecule/default/molecule.yml
      tripleo_ansible/roles/tripleo_network_config/molecule/default/prepare.yml
      tripleo_ansible/roles/tripleo_network_config/molecule/default/converge.yml

    The original patch also fixed molecule tests, this part has been removed
    in the cherry-pick.

    Closes-Bug: #1918372
    Change-Id: Ia4d663cd298556c8143eab6e799e68c81bc8235e
    (cherry picked from commit c2aeccc01c76afa53e759fd51ed7d50eb987fd08)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/tripleo-ansible/+/792031
Committed: https://opendev.org/openstack/tripleo-ansible/commit/0aef9a7faa655275701c4dbf7160ae3b12de6dea
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 0aef9a7faa655275701c4dbf7160ae3b12de6dea
Author: Harald Jensås <email address hidden>
Date: Wed Mar 10 05:27:52 2021 +0100

    Fix tripleo_network config conditional

    The conditional used in the NetworkConfig block always
    evaluates to conclude that network config should be
    applied.

    Use | int filter on the slurped os-net-config return
    code file so that the condition does not always evaluate
    to False.

    Conflicts:
      tripleo_ansible/roles/tripleo_network_config/molecule/default/molecule.yml
      tripleo_ansible/roles/tripleo_network_config/molecule/default/prepare.yml
      tripleo_ansible/roles/tripleo_network_config/molecule/default/converge.yml

    The original patch also fixed molecule tests, this part has been removed
    in the cherry-pick.

    Closes-Bug: #1918372
    Change-Id: Ia4d663cd298556c8143eab6e799e68c81bc8235e
    (cherry picked from commit c2aeccc01c76afa53e759fd51ed7d50eb987fd08)

tags: added: in-stable-victoria
tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (stable/train)

Reviewed: https://review.opendev.org/c/openstack/tripleo-ansible/+/792033
Committed: https://opendev.org/openstack/tripleo-ansible/commit/2979a005c949b09259d0099580fe3e8a3faebaf9
Submitter: "Zuul (22348)"
Branch: stable/train

commit 2979a005c949b09259d0099580fe3e8a3faebaf9
Author: Harald Jensås <email address hidden>
Date: Wed Mar 10 05:27:52 2021 +0100

    Fix tripleo_network config conditional

    The conditional used in the NetworkConfig block always
    evaluates to conclude that network config should be
    applied.

    Use | int filter on the slurped os-net-config return
    code file so that the condition does not always evaluate
    to False.

    Conflicts:
      tripleo_ansible/roles/tripleo_network_config/molecule/default/molecule.yml
      tripleo_ansible/roles/tripleo_network_config/molecule/default/prepare.yml
      tripleo_ansible/roles/tripleo_network_config/molecule/default/converge.yml

    The original patch also fixed molecule tests, this part has been removed
    in the cherry-pick.

    Closes-Bug: #1918372
    Change-Id: Ia4d663cd298556c8143eab6e799e68c81bc8235e
    (cherry picked from commit c2aeccc01c76afa53e759fd51ed7d50eb987fd08)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 2.3.0

This issue was fixed in the openstack/tripleo-ansible 2.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 0.8.0

This issue was fixed in the openstack/tripleo-ansible 0.8.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ansible 1.5.4

This issue was fixed in the openstack/tripleo-ansible 1.5.4 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers