Error: More than one line in file '/etc/sysconfig/libvirtd' matches pattern 'LIBVIRTD_ARGS='

Bug #1847288 reported by Michele Baldessari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-nova
Fix Released
Undecided
Michele Baldessari

Bug Description

While testing OSP train against a newer libvirt (libvirt-4.5.0-24.module+el8.1.0+3205+41ff0a42.x86_64) rpm on Centos/RHEL8 based distro, I hit the following error:
Error: /Stage[main]/Nova::Migration::Libvirt/File_line[/etc/sysconfig/libvirtd libvirtd args]/ensure: change from 'absent' to 'present' failed: More than one line in file '/etc/sysconfig/libvirtd' matches pattern 'LIBVIRTD_ARGS='

The culprit is the following snippet:
file_line { '/etc/sysconfig/libvirtd libvirtd args':
  path => '/etc/sysconfig/libvirtd',
  line => 'LIBVIRTD_ARGS="--listen"',
  match => 'LIBVIRTD_ARGS=',
  tag => 'libvirt-file_line',
}

It seems to me that the match would work also when LIBVIRTD_ARGS is commented out and multiple lines are commented out

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

Fix proposed to branch: master
Review: https://review.opendev.org/687338

Changed in puppet-nova:
assignee: nobody → Michele Baldessari (michele)
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/687338
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=8377b33bd1e96eda6342d009f85301c5f9acfc03
Submitter: Zuul
Branch: master

commit 8377b33bd1e96eda6342d009f85301c5f9acfc03
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 8 17:28:28 2019 +0200

    Fix "More than one line in file '/etc/sysconfig/libvirtd' matches pattern" errors

    The current code that matches the LIBVIRTD_ARGS= lines can have multiple
    matches if said line shows up multiple times in a comment and we can end
    up with the following error:

      Error: /Stage[main]/Nova::Migration::Libvirt/File_line[/etc/sysconfig/libvirtd libvirtd args]/
        ensure: change from 'absent' to 'present' failed: More than one line in file '/etc/sysconfig/libvirtd' matches pattern
          'LIBVIRTD_ARGS='

    For the record the sysconfig file that triggered this error had the
    following lines:

      # connects.
      LIBVIRTD_ARGS="--timeout 120"

      # If systemd socket activation is disabled, then the following
      # can be used to listen on TCP/TLS sockets
      #LIBVIRTD_ARGS="--listen"

    Tested this change and I correctly did not fail the deployment anymore.

    Change-Id: Iae595796559cc6551d8ae27e2573122a8a2da15d
    Closes-Bug: #1847288

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/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/687993

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

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/687994

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

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/687995

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

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/687996

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

Reviewed: https://review.opendev.org/687996
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=b876ace5fa102a1a5e9d205282a6e35f1d0fc82f
Submitter: Zuul
Branch: stable/queens

commit b876ace5fa102a1a5e9d205282a6e35f1d0fc82f
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 8 17:28:28 2019 +0200

    Fix "More than one line in file '/etc/sysconfig/libvirtd' matches pattern" errors

    The current code that matches the LIBVIRTD_ARGS= lines can have multiple
    matches if said line shows up multiple times in a comment and we can end
    up with the following error:

      Error: /Stage[main]/Nova::Migration::Libvirt/File_line[/etc/sysconfig/libvirtd libvirtd args]/
        ensure: change from 'absent' to 'present' failed: More than one line in file '/etc/sysconfig/libvirtd' matches pattern
          'LIBVIRTD_ARGS='

    For the record the sysconfig file that triggered this error had the
    following lines:

      # connects.
      LIBVIRTD_ARGS="--timeout 120"

      # If systemd socket activation is disabled, then the following
      # can be used to listen on TCP/TLS sockets
      #LIBVIRTD_ARGS="--listen"

    Tested this change and I correctly did not fail the deployment anymore.

    Change-Id: Iae595796559cc6551d8ae27e2573122a8a2da15d
    Closes-Bug: #1847288
    (cherry picked from commit 8377b33bd1e96eda6342d009f85301c5f9acfc03)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/train)

Reviewed: https://review.opendev.org/687993
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=14651dbf98194ff5d91a5bad672312cc2e3fce15
Submitter: Zuul
Branch: stable/train

commit 14651dbf98194ff5d91a5bad672312cc2e3fce15
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 8 17:28:28 2019 +0200

    Fix "More than one line in file '/etc/sysconfig/libvirtd' matches pattern" errors

    The current code that matches the LIBVIRTD_ARGS= lines can have multiple
    matches if said line shows up multiple times in a comment and we can end
    up with the following error:

      Error: /Stage[main]/Nova::Migration::Libvirt/File_line[/etc/sysconfig/libvirtd libvirtd args]/
        ensure: change from 'absent' to 'present' failed: More than one line in file '/etc/sysconfig/libvirtd' matches pattern
          'LIBVIRTD_ARGS='

    For the record the sysconfig file that triggered this error had the
    following lines:

      # connects.
      LIBVIRTD_ARGS="--timeout 120"

      # If systemd socket activation is disabled, then the following
      # can be used to listen on TCP/TLS sockets
      #LIBVIRTD_ARGS="--listen"

    Tested this change and I correctly did not fail the deployment anymore.

    Change-Id: Iae595796559cc6551d8ae27e2573122a8a2da15d
    Closes-Bug: #1847288
    (cherry picked from commit 8377b33bd1e96eda6342d009f85301c5f9acfc03)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/stein)

Reviewed: https://review.opendev.org/687994
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=fd55aae79f2a1c472d852a796d386b7c0c1952e7
Submitter: Zuul
Branch: stable/stein

commit fd55aae79f2a1c472d852a796d386b7c0c1952e7
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 8 17:28:28 2019 +0200

    Fix "More than one line in file '/etc/sysconfig/libvirtd' matches pattern" errors

    The current code that matches the LIBVIRTD_ARGS= lines can have multiple
    matches if said line shows up multiple times in a comment and we can end
    up with the following error:

      Error: /Stage[main]/Nova::Migration::Libvirt/File_line[/etc/sysconfig/libvirtd libvirtd args]/
        ensure: change from 'absent' to 'present' failed: More than one line in file '/etc/sysconfig/libvirtd' matches pattern
          'LIBVIRTD_ARGS='

    For the record the sysconfig file that triggered this error had the
    following lines:

      # connects.
      LIBVIRTD_ARGS="--timeout 120"

      # If systemd socket activation is disabled, then the following
      # can be used to listen on TCP/TLS sockets
      #LIBVIRTD_ARGS="--listen"

    Tested this change and I correctly did not fail the deployment anymore.

    Change-Id: Iae595796559cc6551d8ae27e2573122a8a2da15d
    Closes-Bug: #1847288
    (cherry picked from commit 8377b33bd1e96eda6342d009f85301c5f9acfc03)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/rocky)

Reviewed: https://review.opendev.org/687995
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=f27f46bbb3ef8edc4b65ce4c3298b94b4c67b365
Submitter: Zuul
Branch: stable/rocky

commit f27f46bbb3ef8edc4b65ce4c3298b94b4c67b365
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 8 17:28:28 2019 +0200

    Fix "More than one line in file '/etc/sysconfig/libvirtd' matches pattern" errors

    The current code that matches the LIBVIRTD_ARGS= lines can have multiple
    matches if said line shows up multiple times in a comment and we can end
    up with the following error:

      Error: /Stage[main]/Nova::Migration::Libvirt/File_line[/etc/sysconfig/libvirtd libvirtd args]/
        ensure: change from 'absent' to 'present' failed: More than one line in file '/etc/sysconfig/libvirtd' matches pattern
          'LIBVIRTD_ARGS='

    For the record the sysconfig file that triggered this error had the
    following lines:

      # connects.
      LIBVIRTD_ARGS="--timeout 120"

      # If systemd socket activation is disabled, then the following
      # can be used to listen on TCP/TLS sockets
      #LIBVIRTD_ARGS="--listen"

    Tested this change and I correctly did not fail the deployment anymore.

    Change-Id: Iae595796559cc6551d8ae27e2573122a8a2da15d
    Closes-Bug: #1847288
    (cherry picked from commit 8377b33bd1e96eda6342d009f85301c5f9acfc03)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 16.0.0

This issue was fixed in the openstack/puppet-nova 16.0.0 release.

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

This issue was fixed in the openstack/puppet-nova queens-eol release.

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

This issue was fixed in the openstack/puppet-nova rocky-eol release.

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

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