iblox 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/iblox +8 -1
- data/lib/iblox.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee8a49963d8d1792b51192d3a60d58ec43b639bf
|
4
|
+
data.tar.gz: edf9dda21a2f6683da75277a7a70abd5a5c0b6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998cc139a6422d5f54329ca306a07b229f08ab56dc48ee00bd0660b9e4e8e5458c4041f96e19732d43c78e384d3c22e69a27cf8b11752e1dfd9c6b6a6b68f9ce
|
7
|
+
data.tar.gz: ee4453101af470ebc97963a22e10acc57c57654912f0e317fe45b0c9ef35c24f98d8a145a79b687eef1d30c146ef4c79aa6eb6fa6af9bbfcadf4794f74b6b689
|
data/bin/iblox
CHANGED
@@ -54,12 +54,20 @@ OptionParser.new do |opts|
|
|
54
54
|
opts.parse!
|
55
55
|
end
|
56
56
|
|
57
|
+
|
57
58
|
options[:facility] = ARGV[0]
|
59
|
+
if options[:facility] == nil
|
60
|
+
raise "Must pass facility (dns/dhcp/both)"
|
61
|
+
end
|
58
62
|
if !options[:facility].match(/(dns|dhcp|both)/)
|
59
63
|
raise "Facility must be one of 'dns', 'dhcp' or 'both'!"
|
60
64
|
end
|
61
65
|
|
62
66
|
options[:action] = ARGV[1]
|
67
|
+
if options[:action] == nil
|
68
|
+
raise "Must pass an action!"
|
69
|
+
end
|
70
|
+
|
63
71
|
if !options[:action].match(/(add|update|delete)/)
|
64
72
|
raise "Action must be one of 'add', 'update' or 'delete'"
|
65
73
|
end
|
@@ -98,7 +106,6 @@ when "dns"
|
|
98
106
|
single_item[:ip] = options[:ip]
|
99
107
|
batch_data.push(single_item)
|
100
108
|
end
|
101
|
-
pp batch_data
|
102
109
|
#connect once
|
103
110
|
connection=Iblox.connect(options[:username],options[:password],options[:host],options[:wapi_version])
|
104
111
|
batch_data.each do |item|
|
data/lib/iblox.rb
CHANGED
@@ -67,10 +67,10 @@ def self.batch_dhcp_load(batch_file)
|
|
67
67
|
entry[:fqdn] = line.split(',')[0].chomp
|
68
68
|
#figure out if this entry is an ip or CIDR
|
69
69
|
if line.split(',')[1].chomp.match('/')
|
70
|
-
puts "CIDR"
|
70
|
+
#puts "CIDR"
|
71
71
|
entry[:network] = line.split(',')[1].chomp
|
72
72
|
else
|
73
|
-
puts "IP"
|
73
|
+
#puts "IP"
|
74
74
|
entry[:ip] = line.split(',')[1].chomp
|
75
75
|
end
|
76
76
|
entry[:mac] = line.split(',')[2].chomp
|