diff options
author | Bin Yang <bin.yang@windriver.com> | 2019-05-16 01:23:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-16 01:23:59 +0000 |
commit | f8f12a81729b812c6b07b55e07013f94e10a5828 (patch) | |
tree | 9bc6d4ef8ae4ea261e5bc8e7b4fc23cdede5d49b /src/k8splugin | |
parent | fe05f71354a64e761bcd4d8b2307d7ede8164302 (diff) | |
parent | e2299647f1022b3167383841869c581c4b362bf1 (diff) |
Merge "Variable used before intialization"
Diffstat (limited to 'src/k8splugin')
-rw-r--r-- | src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go b/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go index 32bca8fb..3f5d80ba 100644 --- a/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go +++ b/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go @@ -46,6 +46,9 @@ type OVNNbctl struct { // Run a command via ovn-nbctl func (ctl *OVNNbctl) Run(args ...string) (string, string, error) { + if ctl.exec == nil { + ctl.exec = kexec.New() + } if ctl.path == "" { nbctlPath, err := ctl.exec.LookPath(ovnNbctlCommand) if err != nil { @@ -53,9 +56,6 @@ func (ctl *OVNNbctl) Run(args ...string) (string, string, error) { } ctl.path = nbctlPath } - if ctl.exec == nil { - ctl.exec = kexec.New() - } stdout := &bytes.Buffer{} stderr := &bytes.Buffer{} |