Skip to content

Commit c1007d8

Browse files
himani2411Himani Anil Deshpande
andauthored
[Kitchen Test] Use os_properties outside it block (#2918)
Co-authored-by: Himani Anil Deshpande <[email protected]>
1 parent ad9059d commit c1007d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
describe 'Check the presence of the cloudwatch package gpg key'
2222
# In Ubuntu >20.04 due to environment variable the keyring is placed under home of the user ubuntu with the permission of root
23-
24-
keyring = os_properties.ubuntu? && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : ''
23+
is_ubuntu = os_properties.ubuntu?
24+
keyring = is_ubuntu && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : ''
2525
sudo = os_properties.redhat_on_docker? ? '' : 'sudo'
2626
describe bash("#{sudo} gpg --list-keys #{keyring}") do
2727
# Don't check exit status for Ubuntu20 because it returns 2 when executed in the validate phase of a created AMI
2828
# os_properties cannot be used in the describe block level. It can be used within an it{} block
29-
its('exit_status') { should eq 0 } unless os_properties.ubuntu?
29+
its('exit_status') { should eq 0 } unless is_ubuntu
3030
its('stdout') { should match /3B789C72/ }
3131
its('stdout') { should match /Amazon CloudWatch Agent/ }
3232
end

0 commit comments

Comments
 (0)