launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15318
[Merge] lp:~jtv/juju-core/mpv-slash into lp:~maas-maintainers/juju-core/maas-provider-skeleton
Jeroen T. Vermeulen has proposed merging lp:~jtv/juju-core/mpv-slash into lp:~maas-maintainers/juju-core/maas-provider-skeleton.
Commit message:
Support slashes in filenames.
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~jtv/juju-core/mpv-slash/+merge/152390
Actually this didn't need any changes. But as they say, if it's not tested, it's broken. The test is what proves that it works.
Except... you could say that it doesn't. Thanks to the latest update to gomaasapi Bootstrap() now gets past the point where it previously failed, and now it hits a "not implemented" panic. So that's where the next branch will go.
Jeroen
--
https://code.launchpad.net/~jtv/juju-core/mpv-slash/+merge/152390
Your team MAAS Maintainers is requested to review the proposed merge of lp:~jtv/juju-core/mpv-slash into lp:~maas-maintainers/juju-core/maas-provider-skeleton.
=== modified file 'environs/maas/storage_test.go'
--- environs/maas/storage_test.go 2013-03-08 07:19:11 +0000
+++ environs/maas/storage_test.go 2013-03-08 12:39:24 +0000
@@ -347,3 +347,24 @@
err = storage.Remove(filename)
c.Assert(err, IsNil)
}
+
+func (s *StorageSuite) TestNamesMayHaveSlashes(c *C) {
+ const filename = "name/with/slashes"
+ content := []byte("File contents")
+ storage := NewStorage(s.environ)
+
+ err := storage.Put(filename, bytes.NewReader(content), int64(len(content)))
+ c.Assert(err, IsNil)
+
+ // There's not much we can say about the anonymous URL, except that
+ // we get one.
+ _, err = storage.URL(filename)
+ c.Assert(err, IsNil)
+
+ reader, err := storage.Get(filename)
+ c.Assert(err, IsNil)
+ defer reader.Close()
+ data, err := ioutil.ReadAll(reader)
+ c.Assert(err, IsNil)
+ c.Check(data, DeepEquals, content)
+}