enaml-ops / omg-cli

it's kind of like an (o)ps (m)anager in (g)olang
Apache License 2.0
15 stars 11 forks source link

Latest Release v0.0.29 gives panic #13

Closed haydonryan closed 8 years ago

haydonryan commented 8 years ago

Panic if there are no params.

./omg-linux azure
**********************************
Director PWD: qd3w6gyrfpd3d3asppat
**********************************
2016/08/18 14:57:06 C0818 14:57:06.916818 35990 utils.go:105] Sorry you need to provide [azure-vnet azure-subnet azure-subscription-id azure-tenant-id azure-client-id azure-client-secret azure-resource-group azure-storage-account azure-security-group azure-ssh-pub-key-path azure-ssh-user azure-private-key-path] flags to continue
panic: Sorry you need to provide [azure-vnet azure-subnet azure-subscription-id azure-tenant-id azure-client-id azure-client-secret azure-resource-group azure-storage-account azure-security-group azure-ssh-pub-key-path azure-ssh-user azure-private-key-path] flags to continue [recovered]
    panic: Sorry you need to provide [azure-vnet azure-subnet azure-subscription-id azure-tenant-id azure-client-id azure-client-secret azure-resource-group azure-storage-account azure-security-group azure-ssh-pub-key-path azure-ssh-user azure-private-key-path] flags to continue

goroutine 1 [running]:
panic(0x9369e0, 0xc42012d940)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli.HandleAction.func1(0xc420165790)
    /go/src/github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli/app.go:476 +0x29e
panic(0x9369e0, 0xc42012d940)
    /usr/local/go/src/runtime/panic.go:458 +0x243
github.com/enaml-ops/omg-cli/vendor/github.com/op/go-logging.(*Logger).Panicf(0xc4200129f0, 0xa20f7c, 0x2e, 0xc42012d710, 0x1, 0x1)
    /go/src/github.com/enaml-ops/omg-cli/vendor/github.com/op/go-logging/logger.go:194 +0x127
github.com/enaml-ops/omg-cli/utils.CheckRequired(0xc42001da40, 0xc420165108, 0xc, 0xc)
    /go/src/github.com/enaml-ops/omg-cli/utils/utils.go:105 +0x274
github.com/enaml-ops/omg-cli/azure-cli.GetAction.func1(0xc42001da40, 0x0, 0x0)
    /go/src/github.com/enaml-ops/omg-cli/azure-cli/azure-cli.go:53 +0xd1
reflect.Value.call(0x947aa0, 0xc42012c780, 0x13, 0xa0333f, 0x4, 0xc420165730, 0x1, 0x1, 0x48caf8, 0x9f6ee0, ...)
    /usr/local/go/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0x947aa0, 0xc42012c780, 0x13, 0xc420165730, 0x1, 0x1, 0x0, 0x138, 0x138)
    /usr/local/go/src/reflect/value.go:302 +0xa4
github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli.HandleAction(0x947aa0, 0xc42012c780, 0xc42001da40, 0x0, 0x0)
    /go/src/github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli/app.go:485 +0x1e0
github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli.Command.Run(0xa04023, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa1da8e, 0x28, 0x0, ...)
    /go/src/github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli/command.go:186 +0xc2b
github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli.(*App).Run(0xc42014a000, 0xc42000c240, 0x2, 0x2, 0x0, 0x0)
    /go/src/github.com/enaml-ops/omg-cli/vendor/github.com/codegangsta/cli/app.go:239 +0x611
main.main()
    /go/src/github.com/enaml-ops/omg-cli/main.go:154 +0x84e
calebwashburn commented 8 years ago

This is the list of required flags that haven't been provided.

-- azure-vnet azure-subnet -- azure-subscription-id -- azure-tenant-id -- azure-client-id -- azure-client-secret -- azure-resource-group -- azure-storage-account -- azure-security-group -- azure-ssh-pub-key-path -- azure-ssh-user -- azure-private-key-path

Let me know if there is suggestion on another approach to provide feedback that these required flags have not been provided.

calebwashburn commented 8 years ago

You can do ./omg-linux azure --help to see list of all flags

haydonryan commented 8 years ago

yes. can we hide the stacktrace?

zmb3 commented 8 years ago

We can and we should. Our users should never see a panic.

On Thu, Aug 18, 2016 at 8:08 AM, Haydon Ryan notifications@github.com wrote:

yes. can we hide the stacktrace?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/enaml-ops/omg-cli/issues/13#issuecomment-240753404, or mute the thread https://github.com/notifications/unsubscribe-auth/AHLav-8iNa6VtQ3VdZDrzP5jgrpzQeA8ks5qhHVrgaJpZM4JnlH- .

zmb3 commented 8 years ago

Fixed with https://github.com/enaml-ops/omg-product-bundle/commit/3464d18a38d3978cf2a049a9dcee333298677776