Skip to content

Commit

Permalink
Improvemets; TODO + bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimiter Naydenov committed Oct 3, 2013
1 parent 1b31b76 commit 909d090
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
3 changes: 3 additions & 0 deletions downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func (d *Download) Done() <-chan Status {

func (d *Download) run(url, dir string) {
defer d.tomb.Done()
// TODO(dimitern) 2013-10-03 bug #1234715
// Add a testing HTTPS storage to verify the
// disableSSLHostnameVerification behavior here.
file, err := download(url, dir, d.disableSSLHostnameVerification)
if err != nil {
err = fmt.Errorf("cannot download %q: %v", url, err)
Expand Down
13 changes: 2 additions & 11 deletions state/api/uniter/charm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package uniter_test
import (
gc "launchpad.net/gocheck"

"launchpad.net/juju-core/environs/config"
envtesting "launchpad.net/juju-core/environs/testing"
"launchpad.net/juju-core/state/api/uniter"
jc "launchpad.net/juju-core/testing/checkers"
)
Expand Down Expand Up @@ -51,16 +51,7 @@ func (s *charmSuite) TestArchiveURL(c *gc.C) {
c.Assert(archiveURL, gc.DeepEquals, s.wordpressCharm.BundleURL())
c.Assert(disableSSLHostnameVerification, jc.IsFalse)

// Change the environment config to have
// "ssl-hostname-verification" false.
envConfig, err := s.State.EnvironConfig()
c.Assert(err, gc.IsNil)
attrs := envConfig.AllAttrs()
attrs["ssl-hostname-verification"] = false
newConfig, err := config.New(config.NoDefaults, attrs)
c.Assert(err, gc.IsNil)
err = s.State.SetEnvironConfig(newConfig)
c.Assert(err, gc.IsNil)
envtesting.SetSSLHostnameVerification(c, s.State, false)

archiveURL, disableSSLHostnameVerification, err = s.apiCharm.ArchiveURL()
c.Assert(err, gc.IsNil)
Expand Down
13 changes: 2 additions & 11 deletions state/apiserver/uniter/uniter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
gc "launchpad.net/gocheck"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/environs/config"
envtesting "launchpad.net/juju-core/environs/testing"
"launchpad.net/juju-core/errors"
"launchpad.net/juju-core/instance"
"launchpad.net/juju-core/juju/testing"
Expand Down Expand Up @@ -854,16 +854,7 @@ func (s *uniterSuite) TestCharmArchiveURL(c *gc.C) {
},
})

// Change the environment config to have
// "ssl-hostname-verification" false.
envConfig, err := s.State.EnvironConfig()
c.Assert(err, gc.IsNil)
attrs := envConfig.AllAttrs()
attrs["ssl-hostname-verification"] = false
newConfig, err := config.New(config.NoDefaults, attrs)
c.Assert(err, gc.IsNil)
err = s.State.SetEnvironConfig(newConfig)
c.Assert(err, gc.IsNil)
envtesting.SetSSLHostnameVerification(c, s.State, false)

result, err = s.uniter.CharmArchiveURL(args)
c.Assert(err, gc.IsNil)
Expand Down

0 comments on commit 909d090

Please sign in to comment.