Code review comment for lp://qastaging/~ev/ubuntu-ci-services-itself/better-structure-and-logging

Revision history for this message
Andy Doan (doanac) wrote :

> CONFDIR is something I invented to let us set a variable configuration
> path rather than having it hardcoded everywhere, which would've made
> our charms not mergeable with trunk. I think we'll need to teach the
> upstart charm to support custom stanzas or specifically the
> environment variables to set. We can then tell the ppa-cleaner to try
> looking under CONFIDR for the unit_config first.
>
> My rationale is this: we shouldn't be deploying configuration on top
> of code. That's a recipe for disaster.

Another thing we could do (take your pick) would be to add a little more
logic to our settings.py module like:

try:
     # This should get set by local_settings.
     path = os.path.join(CONFDIR, '../unit_config')
except NameError:
     path = os.path.join(BASEDIR, '../unit_config')
     if not os.path.exists(path):
         print('hmm, maybe its one level up...')
         path = os.path.join(BASEDIR, '../../conf/unit_config')

or just throw in the towel and do:

  subprocess.check_out(['find', '/', '-name', unit_config])

:)

« Back to merge proposal