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

make postgres resource working in mock runner (for inspec check) #1961

Merged
merged 2 commits into from
Jun 26, 2017

Conversation

chris-rock
Copy link
Contributor

This helps to use the postgres resources in mock environments with empty data better. Also, this is required to get inspec check for https://github.com/dev-sec/postgres-baseline green again

Copy link
Contributor

@adamleff adamleff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for the change makes sense, but why did you use empty strings as defaults instead of nil? It makes it inconsistent with the way we treat non-set default variables in other resources.

Also, you've got some rubocop complaints to deal with.

@@ -11,6 +11,9 @@ class Postgres < Inspec.resource(1)

attr_reader :service, :data_dir, :conf_dir, :conf_path, :version, :cluster
def initialize
@conf_dir = ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why empty strings and not nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree on that one :-)

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Copy link
Contributor

@arlimus arlimus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great update, kudos Chris.
Also thank you Adam for your initial review.

@arlimus arlimus merged commit 9ac36bc into master Jun 26, 2017
@arlimus arlimus deleted the chris-rock/postgres branch June 26, 2017 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants