Skip to content

Commit

Permalink
Make rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiamarchi committed Jun 22, 2014
1 parent cf71773 commit a1923be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 35 deletions.
3 changes: 0 additions & 3 deletions source/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

inherit_from: .rubocop_todo.yml

AllCops:
Exclude:
- 'out/**/*'
Expand Down
16 changes: 0 additions & 16 deletions source/.rubocop_todo.yml

This file was deleted.

14 changes: 5 additions & 9 deletions source/lib/vagrant-openstack-provider/action/sync_folders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def call(env)
"chown -R #{ssh_info[:username]} '#{guestpath}'")

# Generate rsync include commands
includes = rsync_includes.each_with_object([]) { |incl, incls|
includes = rsync_includes.each_with_object([]) do |incl, incls|
incls << '--include'
incls << incl
}
end

# Rsync over to the guest path using the SSH info. add
# .hg/ to exclude list as that isn't covered in
Expand All @@ -94,15 +94,11 @@ def call(env)
ignore_files = ['.hgignore', '.gitignore']
ignore_files.each do |ignore_file|
abs_ignore_file = env[:root_path].to_s + '/' + ignore_file
if File.exist?(abs_ignore_file)
command += ['--exclude-from', abs_ignore_file]
end
command += ['--exclude-from', abs_ignore_file] if File.exist?(abs_ignore_file)
end

r = Vagrant::Util::Subprocess.execute(*command)
if r.exit_code != 0
fail Errors::RsyncError, guestpath: guestpath, hostpath: hostpath, stderr: r.stderr
end
next if Vagrant::Util::Subprocess.execute(*command).exit_code == 0
ail Errors::RsyncError, guestpath: guestpath, hostpath: hostpath, stderr: r.stderr
end
end

Expand Down
10 changes: 3 additions & 7 deletions source/lib/vagrant-openstack-provider/client/nova.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,9 @@ def check_floating_ip(_env, floating_ip)
:accept => :json)

JSON.parse(ip_details)['floating_ips'].each do |ip|
if ip['ip'] == floating_ip
if !ip['instance_id'].nil?
fail "Floating IP #{floating_ip} already assigned to another server"
else
return
end
end
next unless ip['ip'] == floating_ip
return if ip['instance_id'].nil?
fail "Floating IP #{floating_ip} already assigned to another server"
end
fail "Floating IP #{floating_ip} not available for this tenant"
end
Expand Down

0 comments on commit a1923be

Please sign in to comment.