Skip to content

Commit

Permalink
Merge pull request #11 from nimajalali/manta-prompt
Browse files Browse the repository at this point in the history
Prompt for Manta URL instead of hardcoded value when creating manager
  • Loading branch information
nimajalali authored Jan 26, 2018
2 parents 19a18e6 + c1887d4 commit 58d4b18
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion create/manager_triton.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,23 @@ func NewTritonManager(remoteBackend backend.Backend) error {
cfg.TritonURL = result
}

// Manta URL
var mantaURL string
if viper.IsSet("manta_url") {
mantaURL = viper.GetString("manta_url")
} else {
prompt := promptui.Prompt{
Label: "Manta URL",
Default: "https://us-east.manta.joyent.com",
}

result, err := prompt.Run()
if err != nil {
return err
}
mantaURL = result
}

keyMaterial, err := ioutil.ReadFile(cfg.TritonKeyPath)
if err != nil {
return err
Expand All @@ -286,7 +303,7 @@ func NewTritonManager(remoteBackend backend.Backend) error {

config := &triton.ClientConfig{
TritonURL: cfg.TritonURL,
MantaURL: "https://us-east.manta.joyent.com",
MantaURL: mantaURL,
AccountName: cfg.TritonAccount,
Signers: []authentication.Signer{sshKeySigner},
}
Expand Down

0 comments on commit 58d4b18

Please sign in to comment.