Skip to content

Commit

Permalink
Update Stack Mode
Browse files Browse the repository at this point in the history
Fixed error with nil pointer exc
  • Loading branch information
Maksymilian Wojczuk committed Jun 18, 2018
1 parent 215354a commit 849651d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions cliparser/cliparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ func ParseCliArguments(args []string) (cliArguments CliArguments, err error) {
deleteStack = app.Command(DestroyStackMode, "Deletes a stack on aws")
deleteStackName = deleteStack.Arg("stack", "An AWS stack name.").Required().String()

updateStack = app.Command(UpdateStackMode, "Updates a stacj on aws")
updateStackName = updateStack.Arg("stack", "An AWS stack name").String()
updateStackTemplate = updateStack.Arg("template", "A path to the template file.").String()
updateStackImpName = updateStack.Flag("stack", "Sn AWS stack name.").String()
updateStackImpTemplate = updateStack.Flag("template", "A path to the template file.").String()
updateStack = app.Command(UpdateStackMode, "Updates a stack on aws")
updateStackName = updateStack.Arg("stack", "An AWS stack name").String()
updateStackTemplate = updateStack.Arg("template", "A path to the template file.").String()
updateStackImpName = updateStack.Flag("stack", "Sn AWS stack name.").String()
updateStackImpTemplate = updateStack.Flag("template", "A path to the template file.").String()
updateStackCapabilities = updateStack.Flag("capabilities", "Capabilities: CAPABILITY_IAM | CAPABILITY_NAMED_IAM").Enums("CAPABILITY_IAM", "CAPABILITY_NAMED_IAM")

mfaCommand = app.Command(MfaMode, "Create temporary secure credentials with MFA.")
Expand Down Expand Up @@ -141,10 +141,10 @@ func ParseCliArguments(args []string) (cliArguments CliArguments, err error) {
case mfaCommand.FullCommand():
cliArguments.Mode = &MfaMode


// update Stack
case updateStack.FullCommand():
cliArguments.Capabilities = updateStackCapabilities;
cliArguments.Mode = &UpdateStackMode
cliArguments.Capabilities = updateStackCapabilities
if len(*updateStackImpTemplate) > 0 && len(*updateStackImpName) > 0 {
cliArguments.Stack = updateStackImpName
cliArguments.TemplatePath = updateStackImpTemplate
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"github.com/Appliscale/perun/configurator"
"github.com/Appliscale/perun/context"
"github.com/Appliscale/perun/converter"
"github.com/Appliscale/perun/mysession"
"github.com/Appliscale/perun/offlinevalidator"
"github.com/Appliscale/perun/onlinevalidator"
"github.com/Appliscale/perun/stack"
"github.com/Appliscale/perun/mysession"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions mysession/mysession.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package mysession

import (
"errors"
"github.com/Appliscale/perun/cliparser"
"github.com/Appliscale/perun/context"
"github.com/Appliscale/perun/utilities"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/go-ini/ini"
"os"
"os/user"
"time"
"os"
"github.com/Appliscale/perun/cliparser"
)

const dateFormat = "2006-01-02 15:04:05 MST"
Expand Down

0 comments on commit 849651d

Please sign in to comment.