From 5b030d2869cfe960f6a2cdb61d52f502ebf0972c Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Tue, 17 Nov 2020 10:34:46 -0600 Subject: [PATCH] B #4903: Avoid backticks (#436) Co-authored-by: Daniel Clavijo Coca --- src/vnm_mad/remotes/lib/vnm_driver.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vnm_mad/remotes/lib/vnm_driver.rb b/src/vnm_mad/remotes/lib/vnm_driver.rb index 654c59badb..d8951fc6a2 100644 --- a/src/vnm_mad/remotes/lib/vnm_driver.rb +++ b/src/vnm_mad/remotes/lib/vnm_driver.rb @@ -16,7 +16,6 @@ require 'shellwords' require 'open3' -require 'English' ################################################################################ # The VNMMAD module provides the basic abstraction to implement custom @@ -217,10 +216,11 @@ module VNMMAD # Checks wether a NIC exist or not. Returns true/false and the NIC info def nic_exist?(name) - text = `#{command(:ip)} link show #{name}` - status = $CHILD_STATUS.exitstatus + cmd = "#{command(:ip)} link show #{name}" - return true, text if status == 0 + _o, _e, s = Open3.capture3(cmd) + + return true, text if s.exitstatus.zero? [false, text] end