(fc flags.FlagContext)
| 59 | } |
| 60 | |
| 61 | func (cmd *AllowSpaceSSH) Execute(fc flags.FlagContext) error { |
| 62 | space := cmd.spaceReq.GetSpace() |
| 63 | |
| 64 | if space.AllowSSH { |
| 65 | cmd.ui.Say(T("ssh support is already enabled in space '{{.SpaceName}}'", |
| 66 | map[string]interface{}{ |
| 67 | "SpaceName": space.Name, |
| 68 | }, |
| 69 | )) |
| 70 | return nil |
| 71 | } |
| 72 | |
| 73 | cmd.ui.Say(T("Enabling ssh support for space '{{.SpaceName}}'...", |
| 74 | map[string]interface{}{ |
| 75 | "SpaceName": space.Name, |
| 76 | }, |
| 77 | )) |
| 78 | cmd.ui.Say("") |
| 79 | |
| 80 | err := cmd.spaceRepo.SetAllowSSH(space.GUID, true) |
| 81 | if err != nil { |
| 82 | return errors.New(T("Error enabling ssh support for space ") + space.Name + ": " + err.Error()) |
| 83 | } |
| 84 | |
| 85 | cmd.ui.Ok() |
| 86 | return nil |
| 87 | } |
nothing calls this directly
no test coverage detected