iblox 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/iblox +8 -1
  3. data/lib/iblox.rb +2 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36ea496cb3bfc27dba8fc1cdeacc0d2d1490d1d3
4
- data.tar.gz: ba43ecca3274f223750e3c391faeb17ad3815583
3
+ metadata.gz: ee8a49963d8d1792b51192d3a60d58ec43b639bf
4
+ data.tar.gz: edf9dda21a2f6683da75277a7a70abd5a5c0b6b8
5
5
  SHA512:
6
- metadata.gz: 870d2ec8098b69d2fb132d8496013603e971b35389a2880d3ee317034440462cb35c6811632844f0ebc2c4049dd71b72708165d76afa0259e92138132f2c50b0
7
- data.tar.gz: 87f025a668f38821fb1b390e114e63fd1a37fd14a2e9a5925eec8cdc92120839733ea3d5c05c1b08db3e64567912673c69ffcff244a89e05be4ecc8a0e60c406
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|
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iblox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Nicholson