Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #28 from rogpeppe/029-httprelation-install
Browse files Browse the repository at this point in the history
charmbits/httprelation: register install hook
  • Loading branch information
rogpeppe committed Dec 15, 2014
2 parents 4a8b59b + 22350ee commit dab71ef
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charmbits/httprelation/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (p *Provider) Register(r *hook.Registry, relationName string, allowHTTPS bo
Default: 443,
})
}
r.RegisterHook("install", p.configChanged)
r.RegisterHook("config-changed", p.configChanged)
r.RegisterContext(p.setContext, &p.state)
}
Expand All @@ -81,7 +82,6 @@ func (p *Provider) HTTPSPort() int {
// HTTPSPort returns the configured port of the HTTPS server.
// If the port has not been set, or there is no cert provided, it returns 0.
func (p *Provider) configChanged() error {

if err := p.configurePort(&p.state.OpenedHTTPPort, "http-port"); err != nil {
return errgo.Mask(err)
}
Expand Down
2 changes: 1 addition & 1 deletion charmbits/httprelation/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *providerSuite) testRegister(c *gc.C, withHTTPS bool) {

hooks := r.RegisteredHooks()
sort.Strings(hooks)
c.Assert(hooks, jc.DeepEquals, []string{"config-changed", "foo-relation-joined"})
c.Assert(hooks, jc.DeepEquals, []string{"config-changed", "foo-relation-joined", "install"})
}

func (s *providerSuite) TestPortsReturnZeroAtInstallTime(c *gc.C) {
Expand Down
7 changes: 4 additions & 3 deletions dependencies.tsv
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
code.google.com/p/go.crypto hg 69e2a90ed92d03812364aeb947b7068dc42e561e 235
github.com/juju/cmd git f75cb03fd9ba687f573755b1075a2405f833952d 2014-12-03T02:17:39Z
github.com/juju/errors git fde0386c51c8b9642c392a3a22df4d5058e40fea 2014-11-17T03:41:19Z
github.com/juju/errors git 7a748941731116a391d328fd2ba9744f57efb51b 2014-12-11T10:41:41Z
github.com/juju/gojsonpointer git 0154bf5a168b672d8c97d8dd83a54cb60cd088e8 2014-07-18T03:59:30Z
github.com/juju/gojsonreference git 0673d58f64bacac2db34c7d1e87a599d58923981 2014-07-18T03:57:39Z
github.com/juju/gojsonschema git 33fa79718fa9b24e2a04122f91a75496c0f77098 2014-07-17T16:12:25Z
github.com/juju/juju git 57975cceb12b36b1754f49bcd8c030db8f3800a8 2014-12-06T15:16:23Z
github.com/juju/juju git a1a44269e53e2eb99abb97e17adfeff4f195b41f 2014-12-15T05:01:35Z
github.com/juju/loggo git dc8e19f7c70a62a59c69c40f85b8df09ff20742c 2014-11-17T04:05:26Z
github.com/juju/names git 4bd61d19a7fce663e2821fe05ddf69f774d444da 2014-11-21T15:38:57Z
github.com/juju/schema git 27a52be50766490a6fd3531865095fda6c0eeb6d 2014-07-23T04:23:18Z
github.com/juju/testing git d0fb1a32e1702bda28711881f27c3a255e46ed0d 2014-12-03T16:55:57Z
github.com/juju/utils git 37016f78b9989f99222a5e09a26e25db124c1b17 2014-12-05T02:56:08Z
github.com/juju/utils git cef4ac6468a08abd48e9e373bf866eb149124ec2 2014-12-15T14:40:07Z
golang.org/x/crypto git 1fbbd62cfec66bd39d91e97749579579d4d3037e 2014-12-09T23:26:36Z
gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z
gopkg.in/errgo.v1 git 81357a83344ddd9f7772884874e5622c2a3da21c 2014-10-13T17:33:38Z
gopkg.in/juju/charm.v4 git 7ef31c485ccfd7f1f9571d42ef4395bd04dc1006 2014-11-17T17:46:04Z
Expand Down
2 changes: 1 addition & 1 deletion hook/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"

"github.com/juju/cmd"
"github.com/juju/juju/worker/uniter/context/jujuc"
"github.com/juju/juju/worker/uniter/runner/jujuc"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/errgo.v1"
Expand Down
2 changes: 1 addition & 1 deletion hook/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"

"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/worker/uniter/context/jujuc"
"github.com/juju/juju/worker/uniter/runner/jujuc"
"github.com/juju/utils/set"
. "gopkg.in/check.v1"
"gopkg.in/juju/charm.v4"
Expand Down

0 comments on commit dab71ef

Please sign in to comment.