Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(427)

Issue 7229057: Auto-generate production.ini

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by abentley-home
Modified:
11 years, 3 months ago
Reviewers:
rharding, mp+145420, aaron
Visibility:
Public.

Description

Auto-generate production.ini production.ini is now auto-generated from 1. defaults 2. overrides 3. specific settings from any existing production.ini (session.secret, mongo.port, mongo.host) 4. juju environment Once production.ini is removed from the source tree, this will minimize the chance of conflicts while ensuring production.ini is up-to-date with the defaults. https://code.launchpad.net/~abentley/charms/precise/charmworld/auto-production/+merge/145420 (do not edit description out of merge proposal)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -12 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M common View 1 chunk +3 lines, -5 lines 0 comments Download
M hooks/config-changed View 2 chunks +3 lines, -4 lines 0 comments Download
M hooks/database-relation-broken View 1 chunk +1 line, -1 line 0 comments Download
M hooks/database-relation-changed View 1 chunk +1 line, -1 line 0 comments Download
A production_overrides.ini View 1 chunk +46 lines, -0 lines 0 comments Download
M revision View 1 chunk +1 line, -1 line 0 comments Download
A write_config.py View 1 chunk +57 lines, -0 lines 0 comments Download

Messages

Total messages: 3
abentley-home
Please take a look.
11 years, 3 months ago (2013-01-29 15:54:31 UTC) #1
rharding
lgtm I wonder a little bit if we can reuse the configparser merging code abel ...
11 years, 3 months ago (2013-01-29 16:11:21 UTC) #2
aaron_aaronbentley.com
11 years, 3 months ago (2013-01-29 16:29:14 UTC) #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13-01-29 11:11 AM, rharding@mitechie.com wrote:
> I wonder a little bit if we can reuse the configparser merging code
> abel has in charmworld/lib/config

The code in charmworld/lib/config doesn't do the merging, it delegates
that to ConfigParser.read, the same as mine does.

The bulk of charmworld/lib/config.py is concerned with emitting
warnings when sections and options are used in the override that are
not present in the default.  However, this does not indicate a
problem.  For example, the "logger_exc_logger" section in
production_overrides.ini is entirely legitimate, and it would be
inappropriate in the default, because the default logging
configuration is different.  So that code is not useful in this context.

If I wanted to use Abel's script anyhow, it would need to take 3
inputs: defaults, production overrides, local configuration.  Since it
doesn't, it's not useful here.  If it did, I'd still need a Python
script.  It would use ConfigParser to write out a temporary config for
local configuration.

> Should there be some documentation around to help aid other people 
> working on the charm on how the parts fit together?

To me, the ideal is that the code is clear enough that documentation
is superfluous.  I'm not sure whether we've reached that here.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlEH+NgACgkQ0F+nu1YWqI2TVwCghD7+Rvvcornf81vhFAJZIlwR
TicAn1rcTH29iQ5IRO8yOfwfKjzD63iD
=8cOq
-----END PGP SIGNATURE-----
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b