OLD | NEW |
1 // Copyright 2012, 2013 Canonical Ltd. | 1 // Copyright 2012, 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package dummy | 4 package dummy |
5 | 5 |
6 import ( | 6 import ( |
7 "bytes" | 7 "bytes" |
8 "fmt" | 8 "fmt" |
9 "io" | 9 "io" |
10 "io/ioutil" | 10 "io/ioutil" |
11 "net/http" | 11 "net/http" |
12 "sort" | 12 "sort" |
13 "strings" | 13 "strings" |
14 "time" | 14 "time" |
15 | 15 |
| 16 "github.com/juju/errors" |
| 17 |
16 "launchpad.net/juju-core/environs/storage" | 18 "launchpad.net/juju-core/environs/storage" |
17 "launchpad.net/juju-core/errors" | |
18 "launchpad.net/juju-core/utils" | 19 "launchpad.net/juju-core/utils" |
19 ) | 20 ) |
20 | 21 |
21 // IsSameStorage returns whether the storage instances are the same. | 22 // IsSameStorage returns whether the storage instances are the same. |
22 // Both storages must have been created through the dummy provider. | 23 // Both storages must have been created through the dummy provider. |
23 func IsSameStorage(s1, s2 storage.Storage) bool { | 24 func IsSameStorage(s1, s2 storage.Storage) bool { |
24 localS1, localS2 := s1.(*dummyStorage), s2.(*dummyStorage) | 25 localS1, localS2 := s1.(*dummyStorage), s2.(*dummyStorage) |
25 return localS1.env.name == localS2.env.name | 26 return localS1.env.name == localS2.env.name |
26 } | 27 } |
27 | 28 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 return srv.RemoveAll() | 245 return srv.RemoveAll() |
245 } | 246 } |
246 | 247 |
247 func (s *dummyStorage) List(prefix string) ([]string, error) { | 248 func (s *dummyStorage) List(prefix string) ([]string, error) { |
248 srv, err := s.server() | 249 srv, err := s.server() |
249 if err != nil { | 250 if err != nil { |
250 return nil, err | 251 return nil, err |
251 } | 252 } |
252 return srv.List(prefix) | 253 return srv.List(prefix) |
253 } | 254 } |
OLD | NEW |