Fix compute_nova.pp idempotency granular task.
Change-Id: I29085ea00f3ad96590d7506726263535b2d4484d
Closes-Bug: #1583183
(cherry picked from commit 52f0888af2
)
This commit is contained in:
parent
84c0b28c0c
commit
844e0eb72d
|
@ -43,7 +43,7 @@ class openstack_tasks::openstack_network::compute_nova {
|
||||||
|
|
||||||
exec { 'destroy_libvirt_default_network':
|
exec { 'destroy_libvirt_default_network':
|
||||||
command => 'virsh net-destroy default',
|
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' ],
|
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||||
tries => 3,
|
tries => 3,
|
||||||
require => Service['libvirt'],
|
require => Service['libvirt'],
|
||||||
|
@ -51,13 +51,14 @@ class openstack_tasks::openstack_network::compute_nova {
|
||||||
|
|
||||||
exec { 'undefine_libvirt_default_network':
|
exec { 'undefine_libvirt_default_network':
|
||||||
command => 'virsh net-undefine default',
|
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' ],
|
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||||
tries => 3,
|
tries => 3,
|
||||||
require => Exec['destroy_libvirt_default_network'],
|
require => Exec['destroy_libvirt_default_network'],
|
||||||
}
|
}
|
||||||
|
|
||||||
Service['libvirt'] ~> 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
|
# script called by qemu needs to manipulate the tap device
|
||||||
file_line { 'clear_emulator_capabilities':
|
file_line { 'clear_emulator_capabilities':
|
||||||
|
|
|
@ -99,17 +99,18 @@ describe manifest do
|
||||||
:name => 'libvirtd'
|
: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[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(
|
it { expect(subject).to contain_exec('destroy_libvirt_default_network').with(
|
||||||
:command => 'virsh net-destroy default',
|
: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,
|
:tries => 3,
|
||||||
)}
|
)}
|
||||||
it { expect(subject).to contain_exec('destroy_libvirt_default_network').that_requires('Service[libvirt]')}
|
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(
|
it { expect(subject).to contain_exec('undefine_libvirt_default_network').with(
|
||||||
:command => 'virsh net-undefine default',
|
: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,
|
:tries => 3,
|
||||||
)}
|
)}
|
||||||
it { expect(subject).to contain_exec('undefine_libvirt_default_network').that_requires('Exec[destroy_libvirt_default_network]')}
|
it { expect(subject).to contain_exec('undefine_libvirt_default_network').that_requires('Exec[destroy_libvirt_default_network]')}
|
||||||
|
|
Loading…
Reference in New Issue