From a6f12004ba48b4e1aeba292ffd55dae292af3ada Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Thu, 11 Dec 2014 17:09:13 +0000 Subject: [PATCH 01/11] Moving path to filepath dependency Signed-off-by: Damien DUPORTAL --- drivers/azure/azure.go | 6 +++--- drivers/digitalocean/digitalocean.go | 2 +- drivers/virtualbox/virtualbox.go | 8 ++++---- host.go | 4 ++-- store.go | 12 ++++++------ store_test.go | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/azure/azure.go b/drivers/azure/azure.go index 5895cc4f56..e20b953d4d 100644 --- a/drivers/azure/azure.go +++ b/drivers/azure/azure.go @@ -5,7 +5,7 @@ import ( "net" "os" "os/exec" - "path" + "path/filepath" "strconv" "strings" "time" @@ -476,7 +476,7 @@ func (driver *Driver) generateCertForAzure() error { } func (driver *Driver) sshKeyPath() string { - return path.Join(driver.storePath, "id_rsa") + return filepath.Join(driver.storePath, "id_rsa") } func (driver *Driver) publicSSHKeyPath() string { @@ -484,5 +484,5 @@ func (driver *Driver) publicSSHKeyPath() string { } func (driver *Driver) azureCertPath() string { - return path.Join(driver.storePath, "azure_cert.pem") + return filepath.Join(driver.storePath, "azure_cert.pem") } diff --git a/drivers/digitalocean/digitalocean.go b/drivers/digitalocean/digitalocean.go index 2ef263270f..ee886ff417 100644 --- a/drivers/digitalocean/digitalocean.go +++ b/drivers/digitalocean/digitalocean.go @@ -323,7 +323,7 @@ func (d *Driver) getClient() *godo.Client { } func (d *Driver) sshKeyPath() string { - return path.Join(d.storePath, "id_rsa") + return filepath.Join(d.storePath, "id_rsa") } func (d *Driver) publicSSHKeyPath() string { diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index d913638d8c..5f8180229a 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -209,7 +209,7 @@ func (d *Driver) Create() error { "--port", "0", "--device", "0", "--type", "dvddrive", - "--medium", path.Join(d.storePath, "boot2docker.iso")); err != nil { + "--medium", filepath.Join(d.storePath, "boot2docker.iso")); err != nil { return err } @@ -434,7 +434,7 @@ func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) { } func (d *Driver) sshKeyPath() string { - return path.Join(d.storePath, "id_rsa") + return filepath.Join(d.storePath, "id_rsa") } func (d *Driver) publicSSHKeyPath() string { @@ -442,7 +442,7 @@ func (d *Driver) publicSSHKeyPath() string { } func (d *Driver) diskPath() string { - return path.Join(d.storePath, "disk.vmdk") + return filepath.Join(d.storePath, "disk.vmdk") } // Get the latest boot2docker release tag name (e.g. "v0.6.0"). @@ -490,7 +490,7 @@ func downloadISO(dir, file, url string) error { if err := f.Close(); err != nil { return err } - if err := os.Rename(f.Name(), path.Join(dir, file)); err != nil { + if err := os.Rename(f.Name(), filepath.Join(dir, file)); err != nil { return err } return nil diff --git a/host.go b/host.go index aa3476034b..fde0060b12 100644 --- a/host.go +++ b/host.go @@ -105,7 +105,7 @@ func (h *Host) GetURL() (string, error) { } func (h *Host) LoadConfig() error { - data, err := ioutil.ReadFile(path.Join(h.storePath, "config.json")) + data, err := ioutil.ReadFile(filepath.Join(h.storePath, "config.json")) if err != nil { return err } @@ -135,7 +135,7 @@ func (h *Host) SaveConfig() error { if err != nil { return err } - if err := ioutil.WriteFile(path.Join(h.storePath, "config.json"), data, 0600); err != nil { + if err := ioutil.WriteFile(filepath.Join(h.storePath, "config.json"), data, 0600); err != nil { return err } return nil diff --git a/store.go b/store.go index 0b66925c26..da95471328 100644 --- a/store.go +++ b/store.go @@ -20,7 +20,7 @@ func NewStore() *Store { if err != nil { log.Errorf("error getting home directory : %s", err) } - rootPath := path.Join(homeDir, ".docker/hosts") + rootPath := filepath.Join(homeDir, ".docker/hosts") return &Store{Path: rootPath} } @@ -33,7 +33,7 @@ func (s *Store) Create(name string, driverName string, createFlags interface{}) return nil, fmt.Errorf("Host %q already exists", name) } - hostPath := path.Join(s.Path, name) + hostPath := filepath.Join(s.Path, name) host, err := NewHost(name, driverName, hostPath) if err != nil { @@ -99,7 +99,7 @@ func (s *Store) List() ([]Host, error) { } func (s *Store) Exists(name string) (bool, error) { - _, err := os.Stat(path.Join(s.Path, name)) + _, err := os.Stat(filepath.Join(s.Path, name)) if os.IsNotExist(err) { return false, nil } else if err == nil { @@ -109,7 +109,7 @@ func (s *Store) Exists(name string) (bool, error) { } func (s *Store) Load(name string) (*Host, error) { - hostPath := path.Join(s.Path, name) + hostPath := filepath.Join(s.Path, name) return LoadHost(name, hostPath) } @@ -135,7 +135,7 @@ func (s *Store) IsActive(host *Host) (bool, error) { } func (s *Store) SetActive(host *Host) error { - if err := os.MkdirAll(path.Dir(s.activePath()), 0700); err != nil { + if err := os.MkdirAll(filepath.Dir(s.activePath()), 0700); err != nil { return err } return ioutil.WriteFile(s.activePath(), []byte(host.Name), 0600) @@ -148,5 +148,5 @@ func (s *Store) RemoveActive() error { // activePath returns the path to the file that stores the name of the // active host func (s *Store) activePath() string { - return path.Join(s.Path, ".active") + return filepath.Join(s.Path, ".active") } diff --git a/store_test.go b/store_test.go index 0139bda9d0..bcad6f1854 100644 --- a/store_test.go +++ b/store_test.go @@ -14,7 +14,7 @@ func clearHosts() error { if err != nil { return err } - return os.RemoveAll(path.Join(homeDir, ".docker/hosts")) + return os.RemoveAll(filepath.Join(homeDir, ".docker/hosts")) } func TestStoreCreate(t *testing.T) { @@ -35,7 +35,7 @@ func TestStoreCreate(t *testing.T) { if err != nil { t.Fatal(err) } - path := path.Join(homeDir, ".docker/hosts/test") + path := filepath.Join(homeDir, ".docker/hosts/test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -56,7 +56,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := path.Join(homeDir, ".docker/hosts/test") + path := filepath.Join(homeDir, ".docker/hosts/test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From f3699f0c28655e9905d595bc0b4ecb9e68462a71 Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Thu, 11 Dec 2014 17:18:10 +0000 Subject: [PATCH 02/11] Adding filepath imports Signed-off-by: Damien DUPORTAL --- drivers/digitalocean/digitalocean.go | 2 +- drivers/virtualbox/virtualbox.go | 2 +- host.go | 2 +- store.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/digitalocean/digitalocean.go b/drivers/digitalocean/digitalocean.go index ee886ff417..d8aee7eb03 100644 --- a/drivers/digitalocean/digitalocean.go +++ b/drivers/digitalocean/digitalocean.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" "os/exec" - "path" + "path/filepath" "time" "code.google.com/p/goauth2/oauth" diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index 5f8180229a..4a4ec1a497 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -11,7 +11,7 @@ import ( "net/http" "os" "os/exec" - "path" + "path/filepath" "regexp" "runtime" "strconv" diff --git a/host.go b/host.go index fde0060b12..8a8270dfaf 100644 --- a/host.go +++ b/host.go @@ -5,7 +5,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" "regexp" log "github.com/Sirupsen/logrus" diff --git a/store.go b/store.go index da95471328..8df479f278 100644 --- a/store.go +++ b/store.go @@ -4,7 +4,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" log "github.com/Sirupsen/logrus" homedir "github.com/mitchellh/go-homedir" From 8572b749f52d76f2f403965233131bec63c83e2a Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Thu, 11 Dec 2014 22:00:15 +0100 Subject: [PATCH 03/11] Fixing test + forgotten imports Signed-off-by: Damien DUPORTAL --- drivers/utils.go | 2 +- store.go | 2 +- store_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/utils.go b/drivers/utils.go index 6f0b714b51..102a329c3d 100644 --- a/drivers/utils.go +++ b/drivers/utils.go @@ -13,7 +13,7 @@ func PublicKeyPath() string { if err != nil { homeDir = "" } - return filepath.Join(homeDir, ".docker/public-key.json") + return filepath.Join(homeDir, ".docker","public-key.json") } func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error { diff --git a/store.go b/store.go index 8df479f278..10b40c1e98 100644 --- a/store.go +++ b/store.go @@ -20,7 +20,7 @@ func NewStore() *Store { if err != nil { log.Errorf("error getting home directory : %s", err) } - rootPath := filepath.Join(homeDir, ".docker/hosts") + rootPath := filepath.Join(homeDir, ".docker","hosts") return &Store{Path: rootPath} } diff --git a/store_test.go b/store_test.go index bcad6f1854..ac5599006c 100644 --- a/store_test.go +++ b/store_test.go @@ -2,7 +2,7 @@ package main import ( "os" - "path" + "path/filepath" "testing" none "github.com/docker/machine/drivers/none" @@ -14,7 +14,7 @@ func clearHosts() error { if err != nil { return err } - return os.RemoveAll(filepath.Join(homeDir, ".docker/hosts")) + return os.RemoveAll(filepath.Join(homeDir, ".docker","hosts")) } func TestStoreCreate(t *testing.T) { @@ -35,7 +35,7 @@ func TestStoreCreate(t *testing.T) { if err != nil { t.Fatal(err) } - path := filepath.Join(homeDir, ".docker/hosts/test") + path := filepath.Join(homeDir, ".docker","hosts","test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -56,7 +56,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := filepath.Join(homeDir, ".docker/hosts/test") + path := filepath.Join(homeDir, ".docker","hosts","test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From dcdedf0ad097dc20f3bfad1cfd83c11ff9ef4e8e Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Thu, 11 Dec 2014 22:01:43 +0100 Subject: [PATCH 04/11] Gofmt Signed-off-by: Damien DUPORTAL --- drivers/utils.go | 2 +- store.go | 2 +- store_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/utils.go b/drivers/utils.go index 102a329c3d..959f00332b 100644 --- a/drivers/utils.go +++ b/drivers/utils.go @@ -13,7 +13,7 @@ func PublicKeyPath() string { if err != nil { homeDir = "" } - return filepath.Join(homeDir, ".docker","public-key.json") + return filepath.Join(homeDir, ".docker", "public-key.json") } func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error { diff --git a/store.go b/store.go index 10b40c1e98..c8a24f1c32 100644 --- a/store.go +++ b/store.go @@ -20,7 +20,7 @@ func NewStore() *Store { if err != nil { log.Errorf("error getting home directory : %s", err) } - rootPath := filepath.Join(homeDir, ".docker","hosts") + rootPath := filepath.Join(homeDir, ".docker", "hosts") return &Store{Path: rootPath} } diff --git a/store_test.go b/store_test.go index ac5599006c..9399abd1b9 100644 --- a/store_test.go +++ b/store_test.go @@ -14,7 +14,7 @@ func clearHosts() error { if err != nil { return err } - return os.RemoveAll(filepath.Join(homeDir, ".docker","hosts")) + return os.RemoveAll(filepath.Join(homeDir, ".docker", "hosts")) } func TestStoreCreate(t *testing.T) { @@ -35,7 +35,7 @@ func TestStoreCreate(t *testing.T) { if err != nil { t.Fatal(err) } - path := filepath.Join(homeDir, ".docker","hosts","test") + path := filepath.Join(homeDir, ".docker", "hosts", "test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -56,7 +56,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := filepath.Join(homeDir, ".docker","hosts","test") + path := filepath.Join(homeDir, ".docker", "hosts", "test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From 52019047f1ffd379687355f29dafe475d575c984 Mon Sep 17 00:00:00 2001 From: Jeff Mendoza Date: Thu, 11 Dec 2014 16:11:23 -0800 Subject: [PATCH 05/11] Fix #68. Homedir is now detected same as Docker. Signed-off-by: Jeff Mendoza --- drivers/utils.go | 16 +++++++++------- store.go | 8 ++------ store_test.go | 22 +++++----------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/drivers/utils.go b/drivers/utils.go index 6f0b714b51..aaa9d57be0 100644 --- a/drivers/utils.go +++ b/drivers/utils.go @@ -4,16 +4,18 @@ import ( "fmt" "os" "path/filepath" - - homedir "github.com/mitchellh/go-homedir" + "runtime" ) -func PublicKeyPath() string { - homeDir, err := homedir.Dir() - if err != nil { - homeDir = "" +func GetHomeDir() string { + if runtime.GOOS == "windows" { + return os.Getenv("USERPROFILE") } - return filepath.Join(homeDir, ".docker/public-key.json") + return os.Getenv("HOME") +} + +func PublicKeyPath() string { + return filepath.Join(GetHomeDir(), ".docker/public-key.json") } func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error { diff --git a/store.go b/store.go index 0b66925c26..6994cb899a 100644 --- a/store.go +++ b/store.go @@ -7,7 +7,7 @@ import ( "path" log "github.com/Sirupsen/logrus" - homedir "github.com/mitchellh/go-homedir" + "github.com/docker/machine/drivers" ) // Store persists hosts on the filesystem @@ -16,11 +16,7 @@ type Store struct { } func NewStore() *Store { - homeDir, err := homedir.Dir() - if err != nil { - log.Errorf("error getting home directory : %s", err) - } - rootPath := path.Join(homeDir, ".docker/hosts") + rootPath := path.Join(drivers.GetHomeDir(), ".docker/hosts") return &Store{Path: rootPath} } diff --git a/store_test.go b/store_test.go index 0139bda9d0..79af244219 100644 --- a/store_test.go +++ b/store_test.go @@ -5,16 +5,12 @@ import ( "path" "testing" - none "github.com/docker/machine/drivers/none" - homedir "github.com/mitchellh/go-homedir" + "github.com/docker/machine/drivers" + "github.com/docker/machine/drivers/none" ) func clearHosts() error { - homeDir, err := homedir.Dir() - if err != nil { - return err - } - return os.RemoveAll(path.Join(homeDir, ".docker/hosts")) + return os.RemoveAll(path.Join(drivers.GetHomeDir(), ".docker/hosts")) } func TestStoreCreate(t *testing.T) { @@ -31,11 +27,7 @@ func TestStoreCreate(t *testing.T) { if host.Name != "test" { t.Fatal("Host name is incorrect") } - homeDir, err := homedir.Dir() - if err != nil { - t.Fatal(err) - } - path := path.Join(homeDir, ".docker/hosts/test") + path := path.Join(drivers.GetHomeDir(), ".docker/hosts/test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -52,11 +44,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - homeDir, err := homedir.Dir() - if err != nil { - t.Fatal(err) - } - path := path.Join(homeDir, ".docker/hosts/test") + path := path.Join(drivers.GetHomeDir(), ".docker/hosts/test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From ee48b4ae013be42bee651575ca52ef4eb641ad76 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Thu, 11 Dec 2014 16:24:04 -0800 Subject: [PATCH 06/11] Remove mitchellh/go-homedir from godeps Signed-off-by: Ben Firshman --- Godeps/Godeps.json | 4 - .../github.com/mitchellh/go-homedir/LICENSE | 21 ----- .../github.com/mitchellh/go-homedir/README.md | 14 ---- .../mitchellh/go-homedir/homedir.go | 83 ------------------- .../mitchellh/go-homedir/homedir_test.go | 77 ----------------- 5 files changed, 199 deletions(-) delete mode 100644 Godeps/_workspace/src/github.com/mitchellh/go-homedir/LICENSE delete mode 100644 Godeps/_workspace/src/github.com/mitchellh/go-homedir/README.md delete mode 100644 Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go delete mode 100644 Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir_test.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 4e2a32fa9e..7ed76c0ada 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -115,10 +115,6 @@ "ImportPath": "github.com/google/go-querystring/query", "Rev": "30f7a39f4a218feb5325f3aebc60c32a572a8274" }, - { - "ImportPath": "github.com/mitchellh/go-homedir", - "Rev": "7d2d8c8a4e078ce3c58736ab521a40b37a504c52" - }, { "ImportPath": "github.com/tent/http-link-go", "Rev": "ac974c61c2f990f4115b119354b5e0b47550e888" diff --git a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/LICENSE b/Godeps/_workspace/src/github.com/mitchellh/go-homedir/LICENSE deleted file mode 100644 index f9c841a51e..0000000000 --- a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/README.md b/Godeps/_workspace/src/github.com/mitchellh/go-homedir/README.md deleted file mode 100644 index d70706d5b3..0000000000 --- a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# go-homedir - -This is a Go library for detecting the user's home directory without -the use of cgo, so the library can be used in cross-compilation environments. - -Usage is incredibly simple, just call `homedir.Dir()` to get the home directory -for a user, and `homedir.Expand()` to expand the `~` in a path to the home -directory. - -**Why not just use `os/user`?** The built-in `os/user` package requires -cgo on Darwin systems. This means that any Go code that uses that package -cannot cross compile. But 99% of the time the use for `os/user` is just to -retrieve the home directory, which we can do for the current user without -cgo. This library does that, enabling cross-compilation. diff --git a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go b/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go deleted file mode 100644 index b6d35027b7..0000000000 --- a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go +++ /dev/null @@ -1,83 +0,0 @@ -package homedir - -import ( - "bytes" - "errors" - "os" - "os/exec" - "runtime" - "strings" -) - -// Dir returns the home directory for the executing user. -// -// This uses an OS-specific method for discovering the home directory. -// An error is returned if a home directory cannot be detected. -func Dir() (string, error) { - if runtime.GOOS == "windows" { - return dirWindows() - } - - // Unix-like system, so just assume Unix - return dirUnix() -} - -// Expand expands the path to include the home directory if the path -// is prefixed with `~`. If it isn't prefixed with `~`, the path is -// returned as-is. -func Expand(path string) (string, error) { - if len(path) == 0 { - return path, nil - } - - if path[0] != '~' { - return path, nil - } - - if len(path) > 1 && path[1] != '/' && path[1] != '\\' { - return "", errors.New("cannot expand user-specific home dir") - } - - dir, err := Dir() - if err != nil { - return "", err - } - - return dir + path[1:], nil -} - -func dirUnix() (string, error) { - // First prefer the HOME environmental variable - if home := os.Getenv("HOME"); home != "" { - return home, nil - } - - // If that fails, try the shell - var stdout bytes.Buffer - cmd := exec.Command("sh", "-c", "eval echo ~$USER") - cmd.Stdout = &stdout - if err := cmd.Run(); err != nil { - return "", err - } - - result := strings.TrimSpace(stdout.String()) - if result == "" { - return "", errors.New("blank output when reading home directory") - } - - return result, nil -} - -func dirWindows() (string, error) { - drive := os.Getenv("HOMEDRIVE") - path := os.Getenv("HOMEPATH") - home := drive + path - if drive == "" || path == "" { - home = os.Getenv("USERPROFILE") - } - if home == "" { - return "", errors.New("HOMEDRIVE, HOMEPATH, and USERPROFILE are blank") - } - - return home, nil -} diff --git a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir_test.go b/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir_test.go deleted file mode 100644 index 89e74c3784..0000000000 --- a/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package homedir - -import ( - "fmt" - "os/user" - "testing" -) - -func TestDir(t *testing.T) { - u, err := user.Current() - if err != nil { - t.Fatalf("err: %s", err) - } - - dir, err := Dir() - if err != nil { - t.Fatalf("err: %s", err) - } - - if u.HomeDir != dir { - t.Fatalf("%#v != %#v", u.HomeDir, dir) - } -} - -func TestExpand(t *testing.T) { - u, err := user.Current() - if err != nil { - t.Fatalf("err: %s", err) - } - - cases := []struct { - Input string - Output string - Err bool - }{ - { - "/foo", - "/foo", - false, - }, - - { - "~/foo", - fmt.Sprintf("%s/foo", u.HomeDir), - false, - }, - - { - "", - "", - false, - }, - - { - "~", - u.HomeDir, - false, - }, - - { - "~foo/foo", - "", - true, - }, - } - - for _, tc := range cases { - actual, err := Expand(tc.Input) - if (err != nil) != tc.Err { - t.Fatalf("Input: %#v\n\nErr: %s", tc.Input, err) - } - - if actual != tc.Output { - t.Fatalf("Input: %#v\n\nOutput: %#v", tc.Input, actual) - } - } -} From ad8431d5e533b96fb6e6e697e24de2961d4aaec8 Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Thu, 11 Dec 2014 17:09:13 +0000 Subject: [PATCH 07/11] Correcting filepathes to gain Windows compatibility Signed-off-by: Damien DUPORTAL --- drivers/azure/azure.go | 6 +++--- drivers/digitalocean/digitalocean.go | 4 ++-- drivers/utils.go | 2 +- drivers/virtualbox/virtualbox.go | 10 +++++----- host.go | 6 +++--- store.go | 14 +++++++------- store_test.go | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/azure/azure.go b/drivers/azure/azure.go index 5895cc4f56..e20b953d4d 100644 --- a/drivers/azure/azure.go +++ b/drivers/azure/azure.go @@ -5,7 +5,7 @@ import ( "net" "os" "os/exec" - "path" + "path/filepath" "strconv" "strings" "time" @@ -476,7 +476,7 @@ func (driver *Driver) generateCertForAzure() error { } func (driver *Driver) sshKeyPath() string { - return path.Join(driver.storePath, "id_rsa") + return filepath.Join(driver.storePath, "id_rsa") } func (driver *Driver) publicSSHKeyPath() string { @@ -484,5 +484,5 @@ func (driver *Driver) publicSSHKeyPath() string { } func (driver *Driver) azureCertPath() string { - return path.Join(driver.storePath, "azure_cert.pem") + return filepath.Join(driver.storePath, "azure_cert.pem") } diff --git a/drivers/digitalocean/digitalocean.go b/drivers/digitalocean/digitalocean.go index 2ef263270f..d8aee7eb03 100644 --- a/drivers/digitalocean/digitalocean.go +++ b/drivers/digitalocean/digitalocean.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" "os/exec" - "path" + "path/filepath" "time" "code.google.com/p/goauth2/oauth" @@ -323,7 +323,7 @@ func (d *Driver) getClient() *godo.Client { } func (d *Driver) sshKeyPath() string { - return path.Join(d.storePath, "id_rsa") + return filepath.Join(d.storePath, "id_rsa") } func (d *Driver) publicSSHKeyPath() string { diff --git a/drivers/utils.go b/drivers/utils.go index 6f0b714b51..959f00332b 100644 --- a/drivers/utils.go +++ b/drivers/utils.go @@ -13,7 +13,7 @@ func PublicKeyPath() string { if err != nil { homeDir = "" } - return filepath.Join(homeDir, ".docker/public-key.json") + return filepath.Join(homeDir, ".docker", "public-key.json") } func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error { diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index d913638d8c..4a4ec1a497 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -11,7 +11,7 @@ import ( "net/http" "os" "os/exec" - "path" + "path/filepath" "regexp" "runtime" "strconv" @@ -209,7 +209,7 @@ func (d *Driver) Create() error { "--port", "0", "--device", "0", "--type", "dvddrive", - "--medium", path.Join(d.storePath, "boot2docker.iso")); err != nil { + "--medium", filepath.Join(d.storePath, "boot2docker.iso")); err != nil { return err } @@ -434,7 +434,7 @@ func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) { } func (d *Driver) sshKeyPath() string { - return path.Join(d.storePath, "id_rsa") + return filepath.Join(d.storePath, "id_rsa") } func (d *Driver) publicSSHKeyPath() string { @@ -442,7 +442,7 @@ func (d *Driver) publicSSHKeyPath() string { } func (d *Driver) diskPath() string { - return path.Join(d.storePath, "disk.vmdk") + return filepath.Join(d.storePath, "disk.vmdk") } // Get the latest boot2docker release tag name (e.g. "v0.6.0"). @@ -490,7 +490,7 @@ func downloadISO(dir, file, url string) error { if err := f.Close(); err != nil { return err } - if err := os.Rename(f.Name(), path.Join(dir, file)); err != nil { + if err := os.Rename(f.Name(), filepath.Join(dir, file)); err != nil { return err } return nil diff --git a/host.go b/host.go index aa3476034b..8a8270dfaf 100644 --- a/host.go +++ b/host.go @@ -5,7 +5,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" "regexp" log "github.com/Sirupsen/logrus" @@ -105,7 +105,7 @@ func (h *Host) GetURL() (string, error) { } func (h *Host) LoadConfig() error { - data, err := ioutil.ReadFile(path.Join(h.storePath, "config.json")) + data, err := ioutil.ReadFile(filepath.Join(h.storePath, "config.json")) if err != nil { return err } @@ -135,7 +135,7 @@ func (h *Host) SaveConfig() error { if err != nil { return err } - if err := ioutil.WriteFile(path.Join(h.storePath, "config.json"), data, 0600); err != nil { + if err := ioutil.WriteFile(filepath.Join(h.storePath, "config.json"), data, 0600); err != nil { return err } return nil diff --git a/store.go b/store.go index 0b66925c26..c8a24f1c32 100644 --- a/store.go +++ b/store.go @@ -4,7 +4,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" log "github.com/Sirupsen/logrus" homedir "github.com/mitchellh/go-homedir" @@ -20,7 +20,7 @@ func NewStore() *Store { if err != nil { log.Errorf("error getting home directory : %s", err) } - rootPath := path.Join(homeDir, ".docker/hosts") + rootPath := filepath.Join(homeDir, ".docker", "hosts") return &Store{Path: rootPath} } @@ -33,7 +33,7 @@ func (s *Store) Create(name string, driverName string, createFlags interface{}) return nil, fmt.Errorf("Host %q already exists", name) } - hostPath := path.Join(s.Path, name) + hostPath := filepath.Join(s.Path, name) host, err := NewHost(name, driverName, hostPath) if err != nil { @@ -99,7 +99,7 @@ func (s *Store) List() ([]Host, error) { } func (s *Store) Exists(name string) (bool, error) { - _, err := os.Stat(path.Join(s.Path, name)) + _, err := os.Stat(filepath.Join(s.Path, name)) if os.IsNotExist(err) { return false, nil } else if err == nil { @@ -109,7 +109,7 @@ func (s *Store) Exists(name string) (bool, error) { } func (s *Store) Load(name string) (*Host, error) { - hostPath := path.Join(s.Path, name) + hostPath := filepath.Join(s.Path, name) return LoadHost(name, hostPath) } @@ -135,7 +135,7 @@ func (s *Store) IsActive(host *Host) (bool, error) { } func (s *Store) SetActive(host *Host) error { - if err := os.MkdirAll(path.Dir(s.activePath()), 0700); err != nil { + if err := os.MkdirAll(filepath.Dir(s.activePath()), 0700); err != nil { return err } return ioutil.WriteFile(s.activePath(), []byte(host.Name), 0600) @@ -148,5 +148,5 @@ func (s *Store) RemoveActive() error { // activePath returns the path to the file that stores the name of the // active host func (s *Store) activePath() string { - return path.Join(s.Path, ".active") + return filepath.Join(s.Path, ".active") } diff --git a/store_test.go b/store_test.go index 0139bda9d0..9399abd1b9 100644 --- a/store_test.go +++ b/store_test.go @@ -2,7 +2,7 @@ package main import ( "os" - "path" + "path/filepath" "testing" none "github.com/docker/machine/drivers/none" @@ -14,7 +14,7 @@ func clearHosts() error { if err != nil { return err } - return os.RemoveAll(path.Join(homeDir, ".docker/hosts")) + return os.RemoveAll(filepath.Join(homeDir, ".docker", "hosts")) } func TestStoreCreate(t *testing.T) { @@ -35,7 +35,7 @@ func TestStoreCreate(t *testing.T) { if err != nil { t.Fatal(err) } - path := path.Join(homeDir, ".docker/hosts/test") + path := filepath.Join(homeDir, ".docker", "hosts", "test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -56,7 +56,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := path.Join(homeDir, ".docker/hosts/test") + path := filepath.Join(homeDir, ".docker", "hosts", "test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From 502bdda07d661fef51ba3aa643a67878b88dc038 Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Thu, 11 Dec 2014 17:09:13 +0000 Subject: [PATCH 08/11] # This is a combination of 2 commits. # The first commit's message is: Correcting filepathes to gain Windows compatibility Signed-off-by: Damien DUPORTAL # This is the 2nd commit message: Adding filepath imports Signed-off-by: Damien DUPORTAL --- drivers/azure/azure.go | 6 +++--- drivers/digitalocean/digitalocean.go | 4 ++-- drivers/virtualbox/virtualbox.go | 10 +++++----- host.go | 6 +++--- store.go | 12 ++++++------ store_test.go | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/azure/azure.go b/drivers/azure/azure.go index 1e1175098d..64ad957b55 100644 --- a/drivers/azure/azure.go +++ b/drivers/azure/azure.go @@ -5,7 +5,7 @@ import ( "net" "os" "os/exec" - "path" + "path/filepath" "strconv" "strings" "time" @@ -562,7 +562,7 @@ func (driver *Driver) generateCertForAzure() error { } func (driver *Driver) sshKeyPath() string { - return path.Join(driver.storePath, "id_rsa") + return filepath.Join(driver.storePath, "id_rsa") } func (driver *Driver) publicSSHKeyPath() string { @@ -570,5 +570,5 @@ func (driver *Driver) publicSSHKeyPath() string { } func (driver *Driver) azureCertPath() string { - return path.Join(driver.storePath, "azure_cert.pem") + return filepath.Join(driver.storePath, "azure_cert.pem") } diff --git a/drivers/digitalocean/digitalocean.go b/drivers/digitalocean/digitalocean.go index 2ef263270f..d8aee7eb03 100644 --- a/drivers/digitalocean/digitalocean.go +++ b/drivers/digitalocean/digitalocean.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" "os/exec" - "path" + "path/filepath" "time" "code.google.com/p/goauth2/oauth" @@ -323,7 +323,7 @@ func (d *Driver) getClient() *godo.Client { } func (d *Driver) sshKeyPath() string { - return path.Join(d.storePath, "id_rsa") + return filepath.Join(d.storePath, "id_rsa") } func (d *Driver) publicSSHKeyPath() string { diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index d913638d8c..4a4ec1a497 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -11,7 +11,7 @@ import ( "net/http" "os" "os/exec" - "path" + "path/filepath" "regexp" "runtime" "strconv" @@ -209,7 +209,7 @@ func (d *Driver) Create() error { "--port", "0", "--device", "0", "--type", "dvddrive", - "--medium", path.Join(d.storePath, "boot2docker.iso")); err != nil { + "--medium", filepath.Join(d.storePath, "boot2docker.iso")); err != nil { return err } @@ -434,7 +434,7 @@ func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) { } func (d *Driver) sshKeyPath() string { - return path.Join(d.storePath, "id_rsa") + return filepath.Join(d.storePath, "id_rsa") } func (d *Driver) publicSSHKeyPath() string { @@ -442,7 +442,7 @@ func (d *Driver) publicSSHKeyPath() string { } func (d *Driver) diskPath() string { - return path.Join(d.storePath, "disk.vmdk") + return filepath.Join(d.storePath, "disk.vmdk") } // Get the latest boot2docker release tag name (e.g. "v0.6.0"). @@ -490,7 +490,7 @@ func downloadISO(dir, file, url string) error { if err := f.Close(); err != nil { return err } - if err := os.Rename(f.Name(), path.Join(dir, file)); err != nil { + if err := os.Rename(f.Name(), filepath.Join(dir, file)); err != nil { return err } return nil diff --git a/host.go b/host.go index aa3476034b..8a8270dfaf 100644 --- a/host.go +++ b/host.go @@ -5,7 +5,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" "regexp" log "github.com/Sirupsen/logrus" @@ -105,7 +105,7 @@ func (h *Host) GetURL() (string, error) { } func (h *Host) LoadConfig() error { - data, err := ioutil.ReadFile(path.Join(h.storePath, "config.json")) + data, err := ioutil.ReadFile(filepath.Join(h.storePath, "config.json")) if err != nil { return err } @@ -135,7 +135,7 @@ func (h *Host) SaveConfig() error { if err != nil { return err } - if err := ioutil.WriteFile(path.Join(h.storePath, "config.json"), data, 0600); err != nil { + if err := ioutil.WriteFile(filepath.Join(h.storePath, "config.json"), data, 0600); err != nil { return err } return nil diff --git a/store.go b/store.go index 6994cb899a..a6f0df9616 100644 --- a/store.go +++ b/store.go @@ -4,7 +4,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" log "github.com/Sirupsen/logrus" "github.com/docker/machine/drivers" @@ -29,7 +29,7 @@ func (s *Store) Create(name string, driverName string, createFlags interface{}) return nil, fmt.Errorf("Host %q already exists", name) } - hostPath := path.Join(s.Path, name) + hostPath := filepath.Join(s.Path, name) host, err := NewHost(name, driverName, hostPath) if err != nil { @@ -95,7 +95,7 @@ func (s *Store) List() ([]Host, error) { } func (s *Store) Exists(name string) (bool, error) { - _, err := os.Stat(path.Join(s.Path, name)) + _, err := os.Stat(filepath.Join(s.Path, name)) if os.IsNotExist(err) { return false, nil } else if err == nil { @@ -105,7 +105,7 @@ func (s *Store) Exists(name string) (bool, error) { } func (s *Store) Load(name string) (*Host, error) { - hostPath := path.Join(s.Path, name) + hostPath := filepath.Join(s.Path, name) return LoadHost(name, hostPath) } @@ -131,7 +131,7 @@ func (s *Store) IsActive(host *Host) (bool, error) { } func (s *Store) SetActive(host *Host) error { - if err := os.MkdirAll(path.Dir(s.activePath()), 0700); err != nil { + if err := os.MkdirAll(filepath.Dir(s.activePath()), 0700); err != nil { return err } return ioutil.WriteFile(s.activePath(), []byte(host.Name), 0600) @@ -144,5 +144,5 @@ func (s *Store) RemoveActive() error { // activePath returns the path to the file that stores the name of the // active host func (s *Store) activePath() string { - return path.Join(s.Path, ".active") + return filepath.Join(s.Path, ".active") } diff --git a/store_test.go b/store_test.go index 79af244219..b9e251ea43 100644 --- a/store_test.go +++ b/store_test.go @@ -2,7 +2,7 @@ package main import ( "os" - "path" + "path/filepath" "testing" "github.com/docker/machine/drivers" From 503618251eb8e87bb1e6b8d5ac2a907568e85f9d Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Fri, 12 Dec 2014 10:16:47 +0000 Subject: [PATCH 09/11] Reapplying filepath after rebasing from master Signed-off-by: Damien DUPORTAL --- store.go | 2 +- store_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/store.go b/store.go index a6f0df9616..7d1630d3ee 100644 --- a/store.go +++ b/store.go @@ -16,7 +16,7 @@ type Store struct { } func NewStore() *Store { - rootPath := path.Join(drivers.GetHomeDir(), ".docker/hosts") + rootPath := filepath.Join(drivers.GetHomeDir(), ".docker/hosts") return &Store{Path: rootPath} } diff --git a/store_test.go b/store_test.go index b9e251ea43..c0de5a8779 100644 --- a/store_test.go +++ b/store_test.go @@ -10,7 +10,7 @@ import ( ) func clearHosts() error { - return os.RemoveAll(path.Join(drivers.GetHomeDir(), ".docker/hosts")) + return os.RemoveAll(filepath.Join(drivers.GetHomeDir(), ".docker/hosts")) } func TestStoreCreate(t *testing.T) { @@ -27,7 +27,7 @@ func TestStoreCreate(t *testing.T) { if host.Name != "test" { t.Fatal("Host name is incorrect") } - path := path.Join(drivers.GetHomeDir(), ".docker/hosts/test") + path := filepath.Join(drivers.GetHomeDir(), ".docker/hosts/test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -44,7 +44,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := path.Join(drivers.GetHomeDir(), ".docker/hosts/test") + path := filepath.Join(drivers.GetHomeDir(), ".docker/hosts/test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From 6c071b6732e6e4aa50e5bd7d220983227dc79b93 Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Fri, 12 Dec 2014 11:10:44 +0000 Subject: [PATCH 10/11] Get rid of / file separators in profit of filepath.Join which is os independant Signed-off-by: Damien DUPORTAL --- drivers/utils.go | 2 +- store.go | 2 +- store_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/utils.go b/drivers/utils.go index aaa9d57be0..50afb4c6f7 100644 --- a/drivers/utils.go +++ b/drivers/utils.go @@ -15,7 +15,7 @@ func GetHomeDir() string { } func PublicKeyPath() string { - return filepath.Join(GetHomeDir(), ".docker/public-key.json") + return filepath.Join(GetHomeDir(), ".docker","public-key.json") } func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error { diff --git a/store.go b/store.go index 7d1630d3ee..dad879caec 100644 --- a/store.go +++ b/store.go @@ -16,7 +16,7 @@ type Store struct { } func NewStore() *Store { - rootPath := filepath.Join(drivers.GetHomeDir(), ".docker/hosts") + rootPath := filepath.Join(drivers.GetHomeDir(), ".docker","hosts") return &Store{Path: rootPath} } diff --git a/store_test.go b/store_test.go index c0de5a8779..355feac1c5 100644 --- a/store_test.go +++ b/store_test.go @@ -10,7 +10,7 @@ import ( ) func clearHosts() error { - return os.RemoveAll(filepath.Join(drivers.GetHomeDir(), ".docker/hosts")) + return os.RemoveAll(filepath.Join(drivers.GetHomeDir(), ".docker","hosts")) } func TestStoreCreate(t *testing.T) { @@ -27,7 +27,7 @@ func TestStoreCreate(t *testing.T) { if host.Name != "test" { t.Fatal("Host name is incorrect") } - path := filepath.Join(drivers.GetHomeDir(), ".docker/hosts/test") + path := filepath.Join(drivers.GetHomeDir(), ".docker","hosts","test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -44,7 +44,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := filepath.Join(drivers.GetHomeDir(), ".docker/hosts/test") + path := filepath.Join(drivers.GetHomeDir(), ".docker","hosts","test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } From e4604d831fd9762503f5164e5b0399b1fc67c873 Mon Sep 17 00:00:00 2001 From: Damien DUPORTAL Date: Fri, 12 Dec 2014 11:14:52 +0000 Subject: [PATCH 11/11] Gofmt Signed-off-by: Damien DUPORTAL --- drivers/utils.go | 2 +- store.go | 2 +- store_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/utils.go b/drivers/utils.go index 50afb4c6f7..a15b75c6ef 100644 --- a/drivers/utils.go +++ b/drivers/utils.go @@ -15,7 +15,7 @@ func GetHomeDir() string { } func PublicKeyPath() string { - return filepath.Join(GetHomeDir(), ".docker","public-key.json") + return filepath.Join(GetHomeDir(), ".docker", "public-key.json") } func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error { diff --git a/store.go b/store.go index dad879caec..93d13fc703 100644 --- a/store.go +++ b/store.go @@ -16,7 +16,7 @@ type Store struct { } func NewStore() *Store { - rootPath := filepath.Join(drivers.GetHomeDir(), ".docker","hosts") + rootPath := filepath.Join(drivers.GetHomeDir(), ".docker", "hosts") return &Store{Path: rootPath} } diff --git a/store_test.go b/store_test.go index 355feac1c5..2679ff158d 100644 --- a/store_test.go +++ b/store_test.go @@ -10,7 +10,7 @@ import ( ) func clearHosts() error { - return os.RemoveAll(filepath.Join(drivers.GetHomeDir(), ".docker","hosts")) + return os.RemoveAll(filepath.Join(drivers.GetHomeDir(), ".docker", "hosts")) } func TestStoreCreate(t *testing.T) { @@ -27,7 +27,7 @@ func TestStoreCreate(t *testing.T) { if host.Name != "test" { t.Fatal("Host name is incorrect") } - path := filepath.Join(drivers.GetHomeDir(), ".docker","hosts","test") + path := filepath.Join(drivers.GetHomeDir(), ".docker", "hosts", "test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) } @@ -44,7 +44,7 @@ func TestStoreRemove(t *testing.T) { if err != nil { t.Fatal(err) } - path := filepath.Join(drivers.GetHomeDir(), ".docker","hosts","test") + path := filepath.Join(drivers.GetHomeDir(), ".docker", "hosts", "test") if _, err := os.Stat(path); os.IsNotExist(err) { t.Fatalf("Host path doesn't exist: %s", path) }