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

Fix posture check when several versions of postgres #1035

Merged
merged 4 commits into from
Jul 16, 2014

Conversation

tmichelet
Copy link
Contributor

  • don't update self.DB_METRICS, use a new dict instead

- don't update self.DB_METRICS, use a new dict instead
else:
self.instance_metrics[key] = self.COMMON_METRICS.items()
metrics = self.instance_metrics.get(key)
return metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

This will return a list, not a dictionary. The rest of the code won't work with that.

if self._is_9_2_or_above(key, db):
self.instance_metrics[key] = dict(self.COMMON_METRICS.items() + self.NEWER_92_METRICS.items())
else:
self.instance_metrics[key] = dict(self.COMMON_METRICS.items())
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just do

self.instance_metrics[key] = dict(self.COMMON_METRICS)

@remh
Copy link
Contributor

remh commented Jul 16, 2014

Thanks!
Besides the nitpicks it looks great!

tmichelet added a commit that referenced this pull request Jul 16, 2014
Fix posture check when several versions of postgres
@tmichelet tmichelet merged commit 4b3ffd6 into master Jul 16, 2014
@tmichelet tmichelet deleted the tristan/postgre-different-version branch July 16, 2014 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants