Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for the extra device types

  • Loading branch information...
commit 20ba9f7132d45536480452ac3e50d2893b8bb231 1 parent 8595f38
Bob Van Landuyt authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/tasks/add_missing_data.rake
View
14 lib/tasks/add_missing_data.rake
@@ -20,7 +20,9 @@ namespace :db do
router_counter = 0
switch_counter = 0
power_bar_counter = 0
-
+ firewall_counter = 0
+ sts_counter = 0
+
Device.where('device_type IS NULL').each do |device|
if device.name.downcase.include?("server") || device.comment.downcase.include?("server")
device.device_type = 1;
@@ -42,6 +44,16 @@ namespace :db do
device.save!
power_bar_counter +=1
end
+ if device.name.downcase.include?("firewall") || device.comment.downcase.include?("firewall")
+ device.device_type = 5;
+ device.save!
+ power_bar_counter +=1
+ end
+ if device.name.downcase.include?("sts") || device.comment.downcase.include?("sts")
+ device.device_type = 6;
+ device.save!
+ sts_counter +=1
+ end
end
puts "Updated #{server_counter} servers"
puts "Updated #{router_counter} routers"
Please sign in to comment.
Something went wrong with that request. Please try again.