Code review comment for lp:~axwalk/juju-core/windows-storage-datasource-path

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+200953_code.launchpad.net,

Message:
Please take a look.

Description:
environs/storage: use path.Join for datasource

I'm trying to get bootstrap working on Windows again,
and found that the simplestreams lookup was going to
the wrong URL (using '\\' instead of '/' as it should).
This was causing tools lookup to fail.

https://code.launchpad.net/~axwalk/juju-core/windows-storage-datasource-path/+merge/200953

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/49610043/

Affected files (+6, -4 lines):
   A [revision details]
   M environs/storage/storage.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20140106181553-6uzfea71izl68d4l
+New revision: <email address hidden>

Index: environs/storage/storage.go
=== modified file 'environs/storage/storage.go'
--- environs/storage/storage.go 2013-11-01 06:20:19 +0000
+++ environs/storage/storage.go 2014-01-09 05:27:24 +0000
@@ -6,7 +6,7 @@
  import (
   "fmt"
   "io"
- "path/filepath"
+ "path"

   "launchpad.net/juju-core/environs/simplestreams"
   "launchpad.net/juju-core/utils"
@@ -91,10 +91,10 @@
   return &storageSimpleStreamsDataSource{basePath, storage, false}
  }

-func (s *storageSimpleStreamsDataSource) relpath(path string) string {
- relpath := path
+func (s *storageSimpleStreamsDataSource) relpath(storagePath string)
string {
+ relpath := storagePath
   if s.basePath != "" {
- relpath = filepath.Join(s.basePath, relpath)
+ relpath = path.Join(s.basePath, relpath)
   }
   return relpath
  }

« Back to merge proposal