ravening commented on a change in pull request #70:
URL:
https://github.com/apache/cloudstack-cloudmonkey/pull/70#discussion_r514119482
##########
File path: config/config.go
##########
@@ -324,10 +325,13 @@ func (c *Config) UpdateConfig(key string, value string,
update bool) {
}
// NewConfig creates or reload config and loads API cache
-func NewConfig() *Config {
+func NewConfig(configFilePath *string) *Config {
defaultConf := defaultConfig()
defaultConf.Core = nil
defaultConf.ActiveProfile = nil
+ if *configFilePath != "" {
+ defaultConf.ConfigFile, _ = filepath.Abs(*configFilePath)
Review comment:
Its creating config file if the path provided doesnt exist which is not
good
```
# ls
bin CHANGES.md cli cmd cmk.go config Dockerfile go.mod go.sum
LICENSE Makefile performrelease.sh README.md snap vendor
root@mgt01:~/cloudstack-cloudmonkey#
root@mgt01:~/cloudstack-cloudmonkey# ./bin/cmk -c fkTheWholeWorld
Apache CloudStack 🐵 CloudMonkey 6.1.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues
(localcloud) 🐱 > exit
root@mgt01:~/cloudstack-cloudmonkey# ./bin/cmk -c screwCorona
Apache CloudStack 🐵 CloudMonkey 6.1.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues
(localcloud) 🐱 > exit
root@mgt01:~/cloudstack-cloudmonkey# ./bin/cmk -c breakAllStuff
Apache CloudStack 🐵 CloudMonkey 6.1.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues
(localcloud) 🐱 > exit
# ls -lrt
total 96
-rw-r--r-- 1 root root 3926 Oct 29 09:19 README.md
-rw-r--r-- 1 root root 6501 Oct 29 09:19 Makefile
-rw-r--r-- 1 root root 10225 Oct 29 09:19 LICENSE
-rw-r--r-- 1 root root 1498 Oct 29 09:19 Dockerfile
drwxr-xr-x 2 root root 4096 Oct 29 09:19 cli
-rw-r--r-- 1 root root 5294 Oct 29 09:19 CHANGES.md
drwxr-xr-x 2 root root 4096 Oct 29 09:19 cmd
drwxr-xr-x 2 root root 4096 Oct 29 09:19 snap
-rwxr-xr-x 1 root root 5322 Oct 29 09:19 performrelease.sh
-rw-r--r-- 1 root root 4149 Oct 29 09:19 go.sum
-rw-r--r-- 1 root root 1966 Oct 29 09:19 go.mod
drwxr-xr-x 5 root root 4096 Oct 29 09:19 vendor
drwxr-xr-x 2 root root 4096 Oct 29 09:21 config
-rw-r--r-- 1 root root 2108 Oct 29 09:21 cmk.go
drwxr-xr-x 2 root root 4096 Oct 29 09:23 bin
-rw-r--r-- 1 root root 253 Oct 29 09:29 fkTheWholeWorld <<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 root root 253 Oct 29 09:30 screwCorona <<<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 root root 253 Oct 29 09:30 breakAllStuff.
<<<<<<<<<<<<<<<<<<<<<<
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]