Skip to content

Commit

Permalink
DEBUG
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Oct 6, 2023
1 parent d3d733e commit 012b9d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shared/cliconfig/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (c *Config) GetInstanceServer(name string) (incus.InstanceServer, error) {

// Unix socket
if strings.HasPrefix(remote.Addr, "unix:") {
fmt.Fprintf(os.Stderr, "STGRABER: in: remote.Addr=%s\n", remote.Addr)
unixPath := remote.Addr
if unixPath == "unix://" {
// Handle unix socket path overrides.
Expand All @@ -94,19 +95,25 @@ func (c *Config) GetInstanceServer(name string) (incus.InstanceServer, error) {
unixPath = strings.TrimPrefix(strings.TrimPrefix(remote.Addr, "unix:"), "//")
}

fmt.Fprintf(os.Stderr, "STGRABER: old: unixPath=%s\n", strings.TrimPrefix(strings.TrimPrefix(remote.Addr, "unix:"), "//"))
fmt.Fprintf(os.Stderr, "STGRABER: final: unixPath=%s\n", unixPath)
d, err := incus.ConnectIncusUnix(unixPath, args)
if err != nil {
fmt.Fprintf(os.Stderr, "STGRABER: err: err=%v\n", err)
return nil, err
}

if remote.Project != "" && remote.Project != "default" {
fmt.Fprintf(os.Stderr, "STGRABER: remote.Project: project=%s\n", remote.Project)
d = d.UseProject(remote.Project)
}

if c.ProjectOverride != "" {
fmt.Fprintf(os.Stderr, "STGRABER: projectOverride: project=%s\n", c.ProjectOverride)
d = d.UseProject(c.ProjectOverride)
}

fmt.Fprintf(os.Stderr, "STGRABER: out: remote.Addr=%s\n", remote.Addr)
return d, nil
}

Expand Down

0 comments on commit 012b9d3

Please sign in to comment.