-
Notifications
You must be signed in to change notification settings - Fork 5
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
Database fixes for #7. #9
Open
rwf14f
wants to merge
11
commits into
HEP-Puppet:master
Choose a base branch
from
rwf14f:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6fc6469
Explicit Hiera call and few other changes
kashif74 96ba67c
conditional repository installation
kashif74 cff31f9
few typo
kashif74 681bb10
minor correction
kashif74 2fd420d
using puppetlabs-mysql v2.0
7758623
clean up
kashif74 dd4aa54
add mysql module dependency
kashif74 50ddf2b
Merge remote branch 'oxford/master'
rwf14f b4c83f0
updated database creation check
rwf14f f848321
Update Modulefile
rwf14f b598b99
Update metadata.json
rwf14f File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
name 'kreczko-apelpublisher' | ||
name 'heppuppet-apelpublisher' | ||
version '0.0.2' | ||
|
||
author 'kreczko' | ||
author 'HEP-Puppet' | ||
license 'Apache License, Version 2.0' | ||
project_page 'https://github.com/HEP-Puppet' | ||
source '[email protected]:HEP-Puppet/puppet-apelpublisher.git' | ||
summary 'A Puppet module for the installation and setup of a Apel publisher' | ||
description 'A Puppet module for the installation and setup of a Apel publisher' | ||
dependency 'puppetlabs/mysql', '>=0.6.1' | ||
dependency 'puppetlabs/mysql', '>=2.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "kreczko-apelpublisher", | ||
"name": "heppuppet-apelpublisher", | ||
"version": "0.0.2", | ||
"summary": "A Puppet module for the installation and setup of a Apel publisher", | ||
"author": "kreczko", | ||
"author": "HEP-Puppet", | ||
"description": "A Puppet module for the installation and setup of a Apel publisher", | ||
"dependencies": [ | ||
{ | ||
|
@@ -15,4 +15,4 @@ | |
"source": "[email protected]:HEP-Puppet/puppet-apelpublisher.git", | ||
"project_page": "https://github.com/HEP-Puppet", | ||
"license": "Apache License, Version 2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is correct. Shouldn't you use "/usr/bin/test -eq 0" for the test?
What is the behaviour otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it works. grep returns false if the regex doesn't match anything (or if there's a processing error), see "exit status" in grep man page. The exec will only run if stdout of the mysql command contains a line with only a 0 in it. Mysql doesn't allow 0 as a table name and error messages are printed to stderr (and I've removed the redirect to stdout, puppet prints the stderr of onlyif commands if you run it with --debug). So, you only get a 0 in the mysql output if the database exists and there are no tables in the database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 14/03/14 17:28, kreczko wrote:
I've another comment on your initial test, which you should be aware
of. It doesn't matter in this case, but under other circumstances it's
the "/usr/bin/test
...
-eq 0" that's dangerous. In your original test,if the mysql command fails (for whatever reasons),
...
won't produceany output. so the test would be "/usr/bin/test -eq 0" which is invalid
because -eq is missing a parameter. This evaluates to false which
wouldn't cause any problems in this case because it's still false, but
could cause serious problems if the condition would be inverted (unless
=> "/usr/bin/test
...
-ne 0") . If you compare the output of otherscripts or commands, avoid numerical comparison (-eq, -ne), use string
comparison (= or !=) instead and always test for empty strings. Safer
versions of your original test would be either.
'/usr/bin/test "
...
" = "0"' or'/usr/bin/test x
...
= x0'