From 3b0c72d7ad163bbd40472cbc20478fa0c54fefb5 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Thu, 27 May 2021 10:20:27 +0200 Subject: [PATCH] L #-: lint some files (#1251) --- src/cli/onevm | 2 ++ src/vnm_mad/remotes/elastic/vultr_vnm.rb | 10 ++++------ src/vnm_mad/remotes/nodeport/nodeport.rb | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cli/onevm b/src/cli/onevm index ff2fbeb1b3..ea18d9244f 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -1616,7 +1616,9 @@ CommandParser::CmdParser.new(ARGV) do system("ssh #{opts} #{login}@#{ip} -p #{port} #{cmd}") end + # rubocop:disable Style/SpecialGlobalVars $?.exitstatus + # rubocop:enable Style/SpecialGlobalVars end port_desc = <<-EOT.unindent diff --git a/src/vnm_mad/remotes/elastic/vultr_vnm.rb b/src/vnm_mad/remotes/elastic/vultr_vnm.rb index 01aa939203..a453e059ec 100644 --- a/src/vnm_mad/remotes/elastic/vultr_vnm.rb +++ b/src/vnm_mad/remotes/elastic/vultr_vnm.rb @@ -76,12 +76,10 @@ class VultrProvider rc = @client.attach_nic(@deploy_id, opts[:vultr_id]) if VultrError.error?(rc) - if rc.message == 'IP is already attached to a server' - return 0 - else - OpenNebula.log_error("Error assiging #{rc.message}") - return 1 - end + return 0 if rc.message == 'IP is already attached to a server' + + OpenNebula.log_error("Error assiging #{rc.message}") + return 1 end 0 diff --git a/src/vnm_mad/remotes/nodeport/nodeport.rb b/src/vnm_mad/remotes/nodeport/nodeport.rb index 979c9854c4..ed8b58612d 100644 --- a/src/vnm_mad/remotes/nodeport/nodeport.rb +++ b/src/vnm_mad/remotes/nodeport/nodeport.rb @@ -100,7 +100,8 @@ class NodePortDriver < VNMMAD::VNMDriver "#{nic[:bridge]} | true" cmds.add :iptables, '-t nat -D PREROUTING -p tcp --dport ' \ "#{nic[:external_port_range]} -j DNAT --to " \ - "#{nic[:ip]}:#{nic[:internal_port_range]} | true" + "#{nic[:ip]}:#{nic[:internal_port_range]} " \ + '| true' cmds.add :iptables, '-t nat -D POSTROUTING -j MASQUERADE ' \ "-s #{nic[:ip]} | true" end