Skip to content

Instantly share code, notes, and snippets.

View GregSutcliffe's full-sized avatar

Greg "Gwmngilfen" Sutcliffe GregSutcliffe

  • Red Hat
  • Scotland
View GitHub Profile
diff --git a/app/controllers/topbar_sweeper.rb b/app/controllers/topbar_sweeper.rb
index 281bb8f..8b852e1 100644
--- a/app/controllers/topbar_sweeper.rb
+++ b/app/controllers/topbar_sweeper.rb
@@ -1,5 +1,5 @@
class TopbarSweeper < ActionController::Caching::Sweeper
- observe [User, UserRole, Organization, Location]
+ observe [User, UserRole, Usergroup, Organization, Location, Filter]
def after_create(record)
diff --git a/app/controllers/topbar_sweeper.rb b/app/controllers/topbar_sweeper.rb
index 281bb8f..fae9d51 100644
--- a/app/controllers/topbar_sweeper.rb
+++ b/app/controllers/topbar_sweeper.rb
@@ -1,5 +1,5 @@
class TopbarSweeper < ActionController::Caching::Sweeper
- observe [User, UserRole, Organization, Location]
+ observe [User, UserRole, Usergroup, Organization, Location]
def after_create(record)
diff --git a/app/controllers/topbar_sweeper.rb b/app/controllers/topbar_sweeper.rb
index 281bb8f..8b99295 100644
--- a/app/controllers/topbar_sweeper.rb
+++ b/app/controllers/topbar_sweeper.rb
@@ -1,5 +1,5 @@
class TopbarSweeper < ActionController::Caching::Sweeper
- observe [User, UserRole, Organization, Location]
+ observe [User, UserRole, Usergroup, Organization, Location]
def after_create(record)
#!/usr/bin/ruby
#
# Script to migrate forema-proxy settings.yml
# to plugin form
#
# Greg Sutcliffe <gsutclif@redhat.com> 2014
require 'yaml'
modules = [ :general, :tftp, :dns, :dhcp, :puppet, :puppetca, :bmc, :chef, :realm ]
diff --git a/test/dns/dns_config_test.rb b/test/dns/dns_config_test.rb
index 0f6e7ac..a3d6920 100644
--- a/test/dns/dns_config_test.rb
+++ b/test/dns/dns_config_test.rb
@@ -1,8 +1,22 @@
require 'test_helper'
require 'dns/dns_plugin'
+require 'dns/dns'
+require 'dns/providers/nsupdate'
diff --git a/lib/dhcp_api.rb b/lib/dhcp_api.rb
index 818b732..b73f191 100644
--- a/lib/dhcp_api.rb
+++ b/lib/dhcp_api.rb
@@ -104,7 +104,7 @@ class SmartProxy < Sinatra::Base
# delete a record from a network
delete "/dhcp/:network/:record" do
begin
- record = load_subnet[params[:record]]
+ record = load_subnet.reservation_for(params[:record])
diff --git a/lib/net.rb b/lib/net.rb
index 6b0e8ac..2b5a752 100644
--- a/lib/net.rb
+++ b/lib/net.rb
@@ -11,11 +11,7 @@ module Net
eval("self.#{k}= v") if self.respond_to?("#{k}=")
end if opts
- raise Net::LeaseConflict.new("#{self.mac}/#{self.ip}") if opts['state']
-
commit c37d1b121acee7fe0a96b8af199408184407a795
Author: Greg Sutcliffe <gsutclif@redhat.com>
Date: Thu May 8 12:15:41 2014 +0100
Use foreman_url instead of root_url to avoid tunnelling issues
diff --git a/app/views/foreman_setup/provisioners/_step3.html.erb b/app/views/foreman_setup/provisioners/_step3.html.erb
index 19ce6dd..95b8a06 100644
--- a/app/views/foreman_setup/provisioners/_step3.html.erb
+++ b/app/views/foreman_setup/provisioners/_step3.html.erb
diff --git a/lib/proxy/dhcp/subnet.rb b/lib/proxy/dhcp/subnet.rb
index 75ea301..7153cdb 100644
--- a/lib/proxy/dhcp/subnet.rb
+++ b/lib/proxy/dhcp/subnet.rb
@@ -91,12 +91,12 @@ module Proxy::DHCP
end
def has_mac? mac
- records.each {|r| return r if r.mac == mac.downcase }
+ records.each {|r| return r if r.mac == mac.downcase && r.kind == 'reservation' }
diff --git a/spec/acceptance/mod_passenger_spec.rb b/spec/acceptance/mod_passenger_spec.rb
index 0d91b9e..5753982 100644
--- a/spec/acceptance/mod_passenger_spec.rb
+++ b/spec/acceptance/mod_passenger_spec.rb
@@ -71,8 +71,13 @@ describe 'apache::mod::passenger class', :unless => UNSUPPORTED_PLATFORMS.includ
end
describe file(conf_file) do
- it { should contain "PassengerRoot #{passenger_root}" }
- it { should contain "PassengerRuby #{passenger_ruby}" }