def configure_network_adaptor(device, ip, netmask, gateway, nameservers)
      raise "ERROR: invalid IP address: '#{ip}'" unless valid_ipv4?(ip)
      raise "ERROR: invalid netmask: '#{netmask}'" unless valid_ipv4?(netmask)

      # gateway is optional
      if gateway
        raise "ERROR: invalid gateway IP address: '#{gateway}'" unless valid_ipv4?(gateway)
      end
    end
def configure_network_adaptor(device, ip, netmask, gateway, nameservers)
      raise "ERROR: invalid IP address: '#{ip}'" unless valid_ipv4?(ip)
      raise "ERROR: invalid netmask: '#{netmask}'" unless valid_ipv4?(netmask)

      # gateway is optional
      if gateway
        raise "ERROR: invalid gateway IP address: '#{gateway}'" unless valid_ipv4?(gateway)
      end
    end
Configures a single network adapter with a static IP address

 Parameters
 device(String):: device to be configured
 ip(String):: static IP to be set
 netmask(String):: netmask to be set
 gateway(String):: default gateway IP to be set
 nameservers(Array):: array of nameservers to be set