At the moment we have a login request when executing e.g. cobbler completion * which is not intended. We should implement a kind of blacklist where commands are listed that do not require logins.
Examples:
$ make build
building package
go build -o cobbler main.go
creating shell completions
make shell_completions
make[1]: Entering directory '/home/dom/git/cobblercli'
./cobbler completion bash > config/completions/bash/cobbler
Using config file: /home/dom/.cobbler.yaml
error! Failed to login: Post "http://127.0.0.1/cobbler_api": dial tcp 127.0.0.1:80: connect: connection refused
./cobbler completion fish > config/completions/fish/cobbler
Using config file: /home/dom/.cobbler.yaml
error! Failed to login: Post "http://127.0.0.1/cobbler_api": dial tcp 127.0.0.1:80: connect: connection refused
./cobbler completion powershell > config/completions/powershell/cobbler
Using config file: /home/dom/.cobbler.yaml
error! Failed to login: Post "http://127.0.0.1/cobbler_api": dial tcp 127.0.0.1:80: connect: connection refused
./cobbler completion zsh > config/completions/zsh/cobbler
Using config file: /home/dom/.cobbler.yaml
error! Failed to login: Post "http://127.0.0.1/cobbler_api": dial tcp 127.0.0.1:80: connect: connection refused
make[1]: Leaving directory '/home/dom/git/cobblercli'
$ ./cobbler completion zsh | less > cobbler.zsh
Using config file: /home/dom/.cobbler.yaml
error! Failed to login: Post "http://127.0.0.1/cobbler_api": dial tcp 127.0.0.1:80: connect: connection refused
At the moment we have a login request when executing e.g.
cobbler completion *
which is not intended. We should implement a kind of blacklist where commands are listed that do not require logins.Examples:
Those messages are from
stderr
.The login is handled here: https://github.com/cobbler/cli/blob/b82d106bf18bb3f3b874214bece5ea2569b87d17/cmd/root.go#L82-L96
and executed in
initconfig()
.