Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "unless" test condition for ppa repository #613

Merged
merged 2 commits into from
Jul 7, 2016
Merged

Fixed "unless" test condition for ppa repository #613

merged 2 commits into from
Jul 7, 2016

Conversation

nicobn
Copy link

@nicobn nicobn commented Jul 2, 2016

After the repository is added, the ${::apt::sources_list_d}/${sources_list_d_filename} file is created as an empty file.The unless condition of Exec["add-apt-repository-${name}"] calls test -s, which returns 1 if the file is empty. Because the file is empty, the unless condition is never true and the repository is added on every execution. This commit replaces the -s test condition with -f, which is true if the file exists or false otherwise.

…_list_d_filename} file is created as an empty file.

The unless condition of Exec["add-apt-repository-${name}"] calls test -s, which returns 1 if the file is empty. Because
the file is empty, the unless condition is never true and the repository is added on every execution. This commit
replaces the -s test condition with -f, which is true if the file exists or false otherwise.
@daenney
Copy link

daenney commented Jul 2, 2016

Thanks for the fix!

This breaks a number of tests as we check that we get the full command, including what used to be the -s switch. Please check the spec/ directory and update the tests accordingly. We can't merge it otherwise.

See 38263ac. The previous commit makes the tests fail.
@nicobn
Copy link
Author

nicobn commented Jul 6, 2016

As requested, the last commit fixes the broken tests.

@daenney
Copy link

daenney commented Jul 6, 2016

@bmjen @tphoney Could someone take a look at why the Beaker tests fail? Looking at them it's not related to this PR.

@nicobn Could you squash your commits into one so we get one single commit that fixes the bug and adjusts the tests?

@tphoney
Copy link

tphoney commented Jul 6, 2016

@nicobn @daenney one of the errors was a transient issue. I will look further into the other issue.

@tphoney tphoney merged commit 37c8d08 into puppetlabs:master Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants