~hduran-8/juju-core/trunk

  • Committer: Tarmac
  • Author(s): Andrew Wilkins
  • Date: 2014-05-13 01:48:02 UTC
  • mfrom: (2713.1.5 envcmd-inversion)
  • Revision ID: tarmac-20140513014802-d1n958os00gw27zf
[r=axwalk] Invert envcmd relationship

Previously we embedded EnvCommandBase in all commands
requring an environment, and EnvCommandBase included
everything (SetFlags, and Init). The problem with this
is that it was easy to miss initialisation of the
EnvCommandBase type (this happened a few times), which
leads to bad things happening like sync-tools destroying
environments.

I have inverted the relationship so that we now have
envcmd.EnvironCommand, an interface that extends Command
with a SetEnvName method, and EnvCommandBase, which
implements EnvironCommand. A new method, envcmd.Wrap takes
an EnvironCommand and creates a Command that calls
SetEnvName prior to the wrapped method's Init method. If
the environment name cannot be determined, the wrapping
command will error out early.

https://codereview.appspot.com/94350045/
Filename Latest Rev Last Changed Committer Comment Size
..
factory 1863.5.39 10 years ago Tim Penhey Merged container-factory into kvm-local-provider. Diff
kvm 1863.5.39 10 years ago Tim Penhey Merged container-factory into kvm-local-provider. Diff
lxc 1263.2.25 10 years ago Tim Penhey Merge prev pipe. Diff
testing 1863.6.51 10 years ago Tim Penhey Factor out the method. Diff
directory.go 2045.3.12 10 years ago Tim Penhey Move the UniqueDirectory function into utils packa 1.5 KB Diff Download File
directory_test.go 2412.1.1 10 years ago Jesse Meek Change checkers import path change all imports of 1.5 KB Diff Download File
interface.go 2446.3.2 10 years ago Jesse Meek Changed StopContainer to DestroyContainer 1.8 KB Diff Download File
network.go 1863.5.40 10 years ago Tim Penhey Merged container-factory into kvm-local-provider. 929 bytes Diff Download File
package_test.go 2045.3.3 10 years ago Tim Penhey Tests. 214 bytes Diff Download File
userdata.go 2366.14.39 10 years ago Tim Penhey Tweak the warnings. 1.6 KB Diff Download File