Skip to content

Instantly share code, notes, and snippets.

View daviddavis's full-sized avatar

David Davis daviddavis

View GitHub Profile
test "create permissions" do
action = :create
req = lambda {
name = @filter.name + "Cool"
post action, :organization_id => @filter.content_view_definition.organization.label,
:content_view_definition_id=> @filter.content_view_definition.id,
:filter => name
}
assert_authorized(req: req, action: action, permissions: [@edit_perm])
[ INFO 2013-05-08 08:26:50 app] Started POST "/katello/consumers?owner=ACME_Corporation&activation_keys=Test" for 10.10.169.158 at 2013-05-08 08:26:50 -0400
[ INFO 2013-05-08 08:26:50 app] Processing by ErrorsController#routing as JSON
[ INFO 2013-05-08 08:26:50 app] Parameters: {"facts"=>{"uname.sysname"=>"Linux", "dmi.system.uuid"=>"0047b9fb-dbb7-b820-d22c-ac20fd95d3be", "lscpu.l1d_cache"=>"64K", "distribution.name"=>"Red Hat Enterprise Linux Server", "dmi.bios.addr
ess"=>"0xe8000", "distribution.id"=>"Santiago", "dmi.processor.family"=>"Other", "dmi.chassis.manufacturer"=>"Red Hat", "dmi.memory.bank_locator"=>"Not Specified", "lscpu.numa_node(s)"=>"1", "virt.host_type"=>"kvm", "lscpu.l1i_cache"=>"64
K", "lscpu.vendor_id"=>"AuthenticAMD", "virt.is_guest"=>true, "dmi.chassis.security_status"=>"Unknown", "net.interface.eth1.broadcast"=>"10.10.169.255", "dmi.processor.type"=>"Central Processor", "lscpu.hypervisor_vendor"=>"KVM", "lscpu.c
pu_op-mode(s)"=>"32-bit, 64-bit", "dmi.processor.socket_designation"=>"
@daviddavis
daviddavis / gist:5575692
Created May 14, 2013 13:05
my development gems
rails-footnotes
https://github.com/josevalim/rails-footnotes
spring
https://github.com/jonleighton/spring
pry
https://github.com/pry/pry/
unicorn-rails
class ConvertDescriptionsToTextFields < ActiveRecord::Migration
def up
change_column :activation_keys, :description, :text
change_column :changesets, :description, :text
change_column :distributors, :description, :text
change_column :environments, :description, :text
change_column :organizations, :description, :text
change_column :permissions, :description, :text
change_column :products, :description, :text
change_column :providers, :description, :text

Katello Development Primer

Operating System

We generally recommend either the latest version of RHEL6 or Fedora. Fedora tends to have the newest tools for development while RHEL is more stable (Hint: everyone except Mike uses Fedora).

If you don't want to install Fedora on your desktop (boo!) then you can use your favorite VM solution to run katello. We even have some solutions to help you out with that like kvizer.

@daviddavis
daviddavis / katello.log
Created June 18, 2013 14:58
katello log
...
[ INFO 2013-06-18 10:56:22 app] Started GET "/katello/providers/redhat_provider" for 10.3.113.31 at 2013-06-18 10:56:22 -0400
[ INFO 2013-06-18 10:56:22 app] Processing by ProvidersController#redhat_provider as HTML
[DEBUG 2013-06-18 10:56:22 app] Setting locale: en
[DEBUG 2013-06-18 10:56:22 app] Setting current user thread-local variable to admin
[DEBUG 2013-06-18 10:56:22 app] Checking params for providers/redhat_provider
[DEBUG 2013-06-18 10:56:22 app] Authorizing admin for providers/redhat_provider
[ INFO 2013-06-18 10:56:22 app] Compiled widgets/tabs.js (1ms) (pid 26457)
[ INFO 2013-06-18 10:56:22 app] Compiled providers/provider_redhat.js (0ms) (pid 26457)[ INFO 2013-06-18 10:56:22 app] Compiled providers/redhat/index.js (37ms) (pid 26457)
@daviddavis
daviddavis / repositories.log
Created June 19, 2013 18:47
repositories.log
JBoss Enterprise Application Platform
ENABLED REPOSITORY SET
JBoss Enterprise Application Platform 4.3 (RHEL 5 Server) (RPMs)
JBoss Enterprise Application Platform 5 (RHEL 5 Server) (RPMs)
JBoss Enterprise Application Platform 5 (RHEL 6 Server) (RPMs)
JBoss Enterprise Application Platform 6 (RHEL 6 Server) (RPMs)
JBoss Enterprise Web Server
ENABLED REPOSITORY SET
JBoss Enterprise Web Server 1 (RHEL 5 Server) (RPMs)
JBoss Enterprise Web Server 1 (RHEL 6 Server) (RPMs)
@daviddavis
daviddavis / gotcha.rb
Last active December 18, 2015 22:19
Ruby gotcha
class User
DEFAULT_VALUES = {:name => "--",
:roles => [],
:username => "abc123"
}
ROLE = ["developer", "user", "designer", "admin"]
attr_accessor :name, :username, :roles
def available_subscriptions
all_pools = retrieve_all_pools
available_pools = retrieve_available_pools(all_pools).sort
products = @activation_key.content_view ? @activation_key.content_view.products(@environment) : @environment.products
@available_pools = @available_pools.select { |pool| products.any? { |product| product.name == pool[:name] } }
f18 katello ❯❯❯ ack "\S=>\S" | wc -l
2079
f18 katello ❯❯❯ ack "\s=>\s" | wc -l
11645