Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/app/controllers/api/api_controller.rb b/src/app/controllers/api/api_controller.rb
index e2f336e..c9cfb80 100644
--- a/src/app/controllers/api/api_controller.rb
+++ b/src/app/controllers/api/api_controller.rb
@@ -136,7 +136,8 @@ class Api::ApiController < ActionController::Base
def render_exception(status_code, exception)
logger.error pp_exception(exception)
respond_to do |format|
- format.json { render :json => {:errors => [ exception.message ]}, :status => status_code }
+ #json has to be displayMessage for older RHEL 5.7 subscription managers
@thomasmckay
thomasmckay / community-setup.py
Last active December 15, 2015 14:29
Mega Corporation katello setup
#!/usr/bin/env python
#
# ./mega-setup.py --url https://localhost:3000/katello --user admin --password admin --verbose
#
from optparse import OptionParser
import sys
import os
import random
import string
@thomasmckay
thomasmckay / gist:7086206
Last active December 26, 2015 03:29
engine db setup
reset katello db
% cd katello
% git checkout master
% script/katello-reset-dbs development .
init foreman db
% cd foreman
<comment out katello engine in bundler.d/Gemfile.local.rb>

Activation Keys

Routes - config/routes/api/v2.rb

api_resources :activation_keys, :only => [:show, :index, :create, :update, :destroy] do
  api_resources :subscriptions, :only => [:show, :index, :create, :update, :destroy] do
    match '/available' => 'activatoin_keys#available_subscriptions', :via => :get
 end
before_filter :find_system_group, :only => [:index]
before_filter :find_organization, :only => [:index]
before_filter :authorize
def rules
index_systems = lambda do
if @system_group
@system_group && @system_group.readable?
+------------+------------+-----------+-----------+-----------+----------+
| Name | Consumed | Type | Starts | Expires | SLA |
+------------+------------+-----------+-----------+-----------+----------+
| Red Hat Enterprise Linux Server, Premium (8 sockets)(Up to 4 guests) |
| 1 of 17 Physical 12/13/13 6/13/14 Premium |
+------------+------------+-----------+-----------+-----------+----------+
| Red Hat Enterprise Linux Server, Premium (8 sockets)(Up to 4 guests) |
| 0 of 10 Physical 12/13/13 6/13/14 Premium |
+------------+------------+-----------+-----------+-----------+----------+
@thomasmckay
thomasmckay / gist:9763814
Created March 25, 2014 15:10
hammer config.yml
:modules:
- hammer_cli_foreman
- hammer_cli_katello
- hammer_cli_csv
:csv:
:enable_plugin: true
:host: 'https://localhost:3000'
:username: 'admin'
:password: 'changeme'
"Name","Label","Description"
"Green Hat, Inc.","greenhat","Green cowboy hats"
https://docs.openshift.org/latest/minishift/getting-started/installing.html#installing-instructions
I think addons is git clone https://github.com/minishift/minishift/addons into minishift dir
########### Below is cut&paste to destroy and recreate minishift VM ##########################
minishift delete && rm -rf ~/.minishift ~/.kube/*
pushd addons
minishift addons install registry-route
#!/usr/bin/env ruby
require 'json'
inspect_results = JSON.parse(`skopeo inspect #{ARGV[0]}`)
name = inspect_results['Name'].split('/')[-1]
Dir.mkdir(name) unless Dir.exist?(name)