Closed gtema closed 6 years ago
Artem, Thanks for the analysis and patch! Comments and requests:
The PR is updated - formatting changes removed Yes Kurt, this is exactly what is not working - ensure you are trying correct 0.8.11 (happened to me as well) ` [linux@ag-bastion ~]$ wget https://raw.githubusercontent.com/OpenTelekomCloud/otc-tools/master/otc.sh --2018-02-11 09:26:42-- https://raw.githubusercontent.com/OpenTelekomCloud/otc-tools/master/otc.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.64.133, 151.101.128.133, 151.101.0.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.64.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 51368 (50K) [text/plain] Saving to: ‘otc.sh’
otc.sh 100%[========================================================================================================================================>] 50.16K --.-KB/s in 0.04s
2018-02-11 09:26:42 (1.32 MB/s) - ‘otc.sh’ saved [229593]
[linux@ag-bastion ~]$ chmod u+x ./otc.sh [linux@ag-bastion ~]$ grep "VERSION=0.8" ./otc.sh VERSION=0.8.11 [linux@ag-bastion ~]$ rm -rf ./tmp/* [linux@ag-bastion ~]$ wget https://raw.githubusercontent.com/OpenTelekomCloud/otc-tools/master/otc.sh^C [linux@ag-bastion ~]$ ./otc.sh vm list
ERROR: Authentication call failed `
jq
OK, I can reproduce now. This was indeed introduced recently. I need to tolerate empty ECODE ...
without a previous token in tmp (receiver with ver < 0.8.11) it's not possible to login, since
docurl
is invoked throughcurlpost
with "-i" argument what includes headers in the response. In thedocurl
functionjq
is invoked on thecurl
response, what of course fails (when headers are present). So it is required to strip those headers off and analyse pure response body. Unfortunately it is only possible to do this in bash based on 1st empty string, but it should be ok here.For some reason my editor silently purified some line endings, so there are a bit more changes