Browse Source

Fix compute_nova.pp idempotency granular task.

Change-Id: I29085ea00f3ad96590d7506726263535b2d4484d
Closes-Bug: #1583183
tags/10.0.0b1
Maciej Relewicz 3 years ago
parent
commit
52f0888af2
2 changed files with 6 additions and 4 deletions
  1. +3
    -2
      deployment/puppet/openstack_tasks/manifests/openstack_network/compute_nova.pp
  2. +3
    -2
      tests/noop/spec/hosts/openstack-network/compute-nova_spec.rb

+ 3
- 2
deployment/puppet/openstack_tasks/manifests/openstack_network/compute_nova.pp View File

@@ -43,7 +43,7 @@ class openstack_tasks::openstack_network::compute_nova {

exec { 'destroy_libvirt_default_network':
command => 'virsh net-destroy default',
onlyif => 'virsh net-info default | grep -qE "Active:.* yes"',
onlyif => "virsh net-list | grep -qE '^\s*default\s'",
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
tries => 3,
require => Service['libvirt'],
@@ -51,13 +51,14 @@ class openstack_tasks::openstack_network::compute_nova {

exec { 'undefine_libvirt_default_network':
command => 'virsh net-undefine default',
onlyif => 'virsh net-info default 2>&1 > /dev/null',
onlyif => "virsh net-list --all | grep -qE '^\s*default\s'",
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
tries => 3,
require => Exec['destroy_libvirt_default_network'],
}

Service['libvirt'] ~> Exec['destroy_libvirt_default_network']
Service['libvirt'] ~> Exec['undefine_libvirt_default_network']

# script called by qemu needs to manipulate the tap device
file_line { 'clear_emulator_capabilities':

+ 3
- 2
tests/noop/spec/hosts/openstack-network/compute-nova_spec.rb View File

@@ -99,17 +99,18 @@ describe manifest do
:name => 'libvirtd'
)}
it { expect(subject).to contain_service('libvirt').that_notifies('Exec[destroy_libvirt_default_network]') }
it { expect(subject).to contain_service('libvirt').that_notifies('Exec[undefine_libvirt_default_network]') }
#
it { expect(subject).to contain_exec('destroy_libvirt_default_network').with(
:command => 'virsh net-destroy default',
:onlyif => 'virsh net-info default | grep -qE "Active:.* yes"',
:onlyif => "virsh net-list | grep -qE '^\s*default\s'",
:tries => 3,
)}
it { expect(subject).to contain_exec('destroy_libvirt_default_network').that_requires('Service[libvirt]')}
#
it { expect(subject).to contain_exec('undefine_libvirt_default_network').with(
:command => 'virsh net-undefine default',
:onlyif => 'virsh net-info default 2>&1 > /dev/null',
:onlyif => "virsh net-list --all | grep -qE '^\s*default\s'",
:tries => 3,
)}
it { expect(subject).to contain_exec('undefine_libvirt_default_network').that_requires('Exec[destroy_libvirt_default_network]')}

Loading…
Cancel
Save