Skip to content

Instantly share code, notes, and snippets.

@mwhagedorn
mwhagedorn / SettingsIssue.md
Last active August 29, 2015 14:26
Horizon OPENSTACK_NEUTRON_NETWORK = { 'enable_quotas' = True } Setting

If the enable_quotas setting above is not included, or is False this has the following side effects

  • The "CreateNetwork" button disappears on the CreateNetwork view
  • The "CreateSubnet" button disappears on the CreateSubnet view
  • The "CreateRouter" button disappears on the CreateRouter view

These three side effects happen because the code in the views use the following construct (network for example) https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/networks/tables.py#L94

 usages = quotas.tenant_quota_usages(request)
@mwhagedorn
mwhagedorn / External Tools.xml
Created January 6, 2015 15:59
Pycharm Support for Running flake8 against OpenStack Horizon Project
<toolSet name="External Tools">
<tool name="Flake 8 File" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="$ProjectFileDir$/tools/with_venv.sh" />
<option name="PARAMETERS" value="flake8 $FileDir$/$FileName$ " />
<option name="WORKING_DIRECTORY" value="$FileDir$" />
</exec>
<filter>
<option name="NAME" value="Filter 1" />
<option name="DESCRIPTION" value="" />
class Person(val name:String){
def this(firstname:String, lastName:String){
}
}
class Person(name:string)
@mwhagedorn
mwhagedorn / gist:46e39e5a5beaa445b2ff
Created July 1, 2014 20:01
propose excon instrument or with the order of the name reversed
module Excon
module Middleware
class MyInstrumentor < Excon::Middleware::Base
def error_call(datum)
if datum.has_key?(:instrumentor)
datum[:instrumentor].instrument("error.#{datum[:instrumentor_name]}", :error => datum[:error])
end
@stack.error_call(datum)
end
@mwhagedorn
mwhagedorn / gist:d4b5857348bb657dde60
Created June 23, 2014 19:08
OpenStack Service Catalog Entry for Swift
{
"endpoints": [
{
"adminURL": "http://10.0.1.127:8080",
"id": "0c4dfbd237a142249947eb128220d8e7",
"internalURL": "http://10.0.1.127:8080/v1/AUTH_5da62c5bf0df447e84161c6805e8c05d",
"publicURL": "http://10.0.1.127:8080/v1/AUTH_5da62c5bf0df447e84161c6805e8c05d",
"region": "RegionOne"
}
],
@mwhagedorn
mwhagedorn / gist:8306a7c33b3c445c414d
Created June 23, 2014 19:08
HP Public Cloud Service Catalog Entry for Swift
{
"name": "Object Storage",
"type": "object-store",
"endpoints": [
{
"tenantId": "57457043554366",
"publicURL": "https:\/\/region-a.geo-1.objects.hpcloudsvc.com\/v1\/57457043554366",
"region": "region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https:\/\/region-a.geo-1.objects.hpcloudsvc.com\/v1.0\/",
@mwhagedorn
mwhagedorn / gist:e220995935a22031d4e5
Created June 23, 2014 19:06
swift info endpoint
{
"account_quotas": {},
"bulk_delete": {
"max_deletes_per_request": 10000,
"max_failed_deletes": 1000
},
"bulk_upload": {
"max_containers_per_extraction": 10000,
"max_failed_extractions": 1000
},
@mwhagedorn
mwhagedorn / test_context
Created June 19, 2014 13:20
registry for stateful unit tests
class TestContext
class << self
#cache the result of the block
def nova_server(reset = false)
if reset
@nova_server = yield
return @nova_server
end
return @nova_server if @nova_server
@nova_server = yield
@mwhagedorn
mwhagedorn / test_context
Created June 19, 2014 13:19
registry for stateful unit tests
class TestContext
class << self
#@param server_builder proc which
def nova_server(reset = false)
if reset
@nova_server = yield
return @nova_server
end
return @nova_server if @nova_server
@nova_server = yield
@mwhagedorn
mwhagedorn / gist:11292533
Created April 25, 2014 14:59
Path line changed for request_common....
def request_params(params)
params.merge({
:headers => headers(params),
:path => "#{@path}/#{params[:path]}"
})
end