Skip to content

Commit 6019e8f

Browse files
Merge pull request #1906 from guglo/horizon-ipv6fix
IPV6 - Expose methods in chef NetworkHelper to crowbar_framework (SOC-6397)
2 parents 1a9df11 + 5928815 commit 6019e8f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

chef/cookbooks/network/libraries/helpers.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,13 @@ def self.wrap_ip(address)
77
address.to_s
88
end
99
end
10+
11+
def self.ipv6(address)
12+
require "ipaddr"
13+
if IPAddr.new(address).ipv6?
14+
true
15+
else
16+
false
17+
end
18+
end
1019
end

crowbar_framework/config/application.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Application < Rails::Application
2222
# Explicitely eager load /lib/crowbar/lock so we can use SharedNonBlocking
2323
# with threading without hitting circular dependencies
2424
config.eager_load_paths += Dir["#{config.root}/lib/crowbar/lock"]
25+
config.eager_load_paths += Dir["#{config.root}/../chef/cookbooks/network/libraries"]
2526

2627
config.autoload_paths += %W(
2728
#{config.root}/lib

0 commit comments

Comments
 (0)