diff options
author | Ritu Sood <ritu.sood@intel.com> | 2019-05-14 16:48:39 +0000 |
---|---|---|
committer | Ritu Sood <ritu.sood@intel.com> | 2019-05-14 16:48:39 +0000 |
commit | e2299647f1022b3167383841869c581c4b362bf1 (patch) | |
tree | 4749d3d5c56620ce3b01708b8d9b73750e54901e /src/k8splugin/plugins | |
parent | 9b2e8b3e41dd89bd1cb9a661a10d5d76125af5b1 (diff) |
Variable used before intialization
Initialize variable before using
Change-Id: Id908b27d6e17692de4ad3a60e84cd00b496133b9
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Issue-ID: MULTICLOUD-304
Diffstat (limited to 'src/k8splugin/plugins')
-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{} |