forked from toolshed/abra
		
	fix: handle missing ssh keys (pass auth)
This commit is contained in:
		| @ -484,9 +484,6 @@ func EnsureNewHetznerCloudVPSFlags(c *cli.Context) error { | |||||||
| 	if HetznerCloudImage == "" { | 	if HetznerCloudImage == "" { | ||||||
| 		ShowSubcommandHelpAndError(c, fmt.Errorf("missing hetzner cloud image?")) | 		ShowSubcommandHelpAndError(c, fmt.Errorf("missing hetzner cloud image?")) | ||||||
| 	} | 	} | ||||||
| 	if len(HetznerCloudSSHKeys.Value()) == 0 { |  | ||||||
| 		ShowSubcommandHelpAndError(c, fmt.Errorf("missing hetzner cloud ssh keys?")) |  | ||||||
| 	} |  | ||||||
| 	if HetznerCloudLocation == "" { | 	if HetznerCloudLocation == "" { | ||||||
| 		ShowSubcommandHelpAndError(c, fmt.Errorf("missing hetzner cloud VPS location?")) | 		ShowSubcommandHelpAndError(c, fmt.Errorf("missing hetzner cloud VPS location?")) | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -43,13 +43,18 @@ func newHetznerCloudVPS(c *cli.Context) error { | |||||||
| 		Location:   &hcloud.Location{Name: internal.HetznerCloudLocation}, | 		Location:   &hcloud.Location{Name: internal.HetznerCloudLocation}, | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	sshKeyIDs := strings.Join(sshKeysRaw, "\n") | ||||||
|  | 	if sshKeyIDs == "" { | ||||||
|  | 		sshKeyIDs = "N/A (password auth)" | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	tableColumns := []string{"name", "type", "image", "ssh-keys", "location"} | 	tableColumns := []string{"name", "type", "image", "ssh-keys", "location"} | ||||||
| 	table := formatter.CreateTable(tableColumns) | 	table := formatter.CreateTable(tableColumns) | ||||||
| 	table.Append([]string{ | 	table.Append([]string{ | ||||||
| 		internal.HetznerCloudName, | 		internal.HetznerCloudName, | ||||||
| 		internal.HetznerCloudType, | 		internal.HetznerCloudType, | ||||||
| 		internal.HetznerCloudImage, | 		internal.HetznerCloudImage, | ||||||
| 		strings.Join(sshKeysRaw, "\n"), | 		sshKeyIDs, | ||||||
| 		internal.HetznerCloudLocation, | 		internal.HetznerCloudLocation, | ||||||
| 	}) | 	}) | ||||||
| 	table.Render() | 	table.Render() | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user