fix: it does'nt make sence to compare etcd_version, since it's nil. (#2390)

no need to define a new local cluster_version since it's defined previously.
This commit is contained in:
RocFang 2020-10-13 23:15:42 +08:00 committed by GitHub
parent 5614a95758
commit 4776dc8a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -984,7 +984,6 @@ local function init_etcd(show_output)
yaml_conf.etcd.host = {yaml_conf.etcd.host}
end
local cluster_version
local host_count = #(yaml_conf.etcd.host)
local dkjson = require("dkjson")
@ -1032,7 +1031,7 @@ local function init_etcd(show_output)
.. " --max-time " .. timeout * 2 .. " --retry 1 2>&1"
local res = execute_cmd(cmd)
if (etcd_version == "v3" and not res:find("OK", 1, true)) then
if res:find("OK", 1, true) then
is_success = false
if (index == host_count) then
error(cmd .. "\n" .. res)