apache / cloudstack-cloudmonkey

Apache Cloudstack Cloudmonkey
Apache License 2.0
91 stars 60 forks source link

Fix #115: cmk ignores the CLI profile arg when loading the cache file #131

Closed nvazquez closed 1 year ago

nvazquez commented 1 year ago

Fixes: #115

Tests

$ ls ~/.cmk/profiles/
labenv.cache      localcloud.cache
$ grep profile ~/.cmk/config
profile      = 
$ ./bin/cmk -p labenv list tungstenfabricproviders
$
$ ./bin/cmk -p vmware list tungstenfabricproviders
Loaded in-built API cache. Failed to read API cache, please run 'sync'.
🙈 Error: unknown command or API requested
rohityadavcloud commented 1 year ago

What are your thoughts on the expected behaviour - @borisstoyanov @vladimirpetrov @kiranchavala @shwstppr @nvazquez ?

borisstoyanov commented 1 year ago

Agree with your suggestion @rohityadavcloud

rohityadavcloud commented 1 year ago

Thanks @borisstoyanov @nvazquez - I think the fix can be simply:

I was also thinking, what about stale and old caches. For example, I think in the login or API response do we send the ACS version - perhaps another minor idea could be to prompt the user will same message (of running sync) if the API cache is of a different ACS version than the ACS version to which an API call has been made. (just a though)

nvazquez commented 1 year ago

@rohityadavcloud @borisstoyanov can you please review it after the latest changes?