Skip to content

Instantly share code, notes, and snippets.

@gabrielhurley
gabrielhurley / response_example.py
Created January 10, 2012 02:31
Example for cleaner multi-object response messages.
class DeleteGroup(tables.Action):
name = "delete"
verbose_name = _("Delete")
verbose_name_plural = _("Delete Security Groups")
classes = ('danger',)
def allowed(self, request, security_group=None):
if not security_group:
return True
return security_group.name != 'default'
@gabrielhurley
gabrielhurley / keystone_api_test.py
Created January 26, 2012 23:32
This tests itself.
def test_tenant_create(self):
kwargs = {'id': TEST_TENANT_ID,
'description': 'aDescription',
"enabled": True}
tenant = keystoneclient_tenants.Tenant(self.request, kwargs)
keystoneclient = self.stub_keystoneclient()
keystoneclient.tenants = self.mox.CreateMockAnything()
keystoneclient.tenants.create(*kwargs.values()).AndReturn(tenant)
self.mox.ReplayAll()
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of the document</title>
</head>
<body>
<table>
<thead>
<tr>
@gabrielhurley
gabrielhurley / workflows.rst
Created May 2, 2012 02:15
Horizon Workflows API Proposal

Workflows API

This proposal describes how the Workflows API should be constructed.

Contents:

Design Goals

@gabrielhurley
gabrielhurley / admin_server_list.json
Created May 23, 2012 18:21
sample json returned from admin server list call
REQ: GET http://example.com:8774/v2/<tenant_id>/servers/detail?all_tenants=True
RESP:
{
"servers": [
{
"OS-EXT-STS:task_state": null,
"addresses": {
"private": [
@gabrielhurley
gabrielhurley / openstack_translation.rst
Created June 22, 2012 00:02
Translation, Internationalization and Localization in OpenStack

Translation, Internationalization and Localization in OpenStack

OpenStack is committed to broad international support, and as such there must be an ongoing concern with making OpenStack usable for all audiences. This includes proper use of internationalization and localization tools by developers, and high-quality translations for both user-facing messages and documentation.

Table of Contents

@gabrielhurley
gabrielhurley / jenkins_selenium.rst
Created July 2, 2012 19:43
Jenkins Selenium Setup

Selenium Jenkins Integration

Medium detail overview of steps involved

  • Add appropriate packages to build slave:

    sudo apt-get install xvfb          # virtual display
@gabrielhurley
gabrielhurley / proj_membership_html.html
Created July 5, 2012 21:23
structure for project membership HTML
<div class="combo-box">
<div class="header"># Title, actions, filters</div>
<ul class="items">
<li class="item" data-user-id="<user_id>">
<span># Name</span>
<a href="#add/remove"># Add/Remove</a>
<ul class="role dropdown"> # For "included" box only
<li data-role-id="<role_id>"># Role name</li>
</ul>
</li>
@gabrielhurley
gabrielhurley / project_id.diff
Created July 24, 2012 00:11
Project Workflows Add Project ID
diff --git a/horizon/dashboards/syspanel/projects/views.py b/horizon/dashboards/syspanel/projects/views.py
index e5f2f54..ec3a6e6 100644
--- a/horizon/dashboards/syspanel/projects/views.py
+++ b/horizon/dashboards/syspanel/projects/views.py
@@ -182,7 +182,7 @@ class UpdateProjectView(workflows.WorkflowView):
initial = super(UpdateProjectView, self).get_initial()
project_id = self.kwargs['tenant_id']
- initial['id'] = project_id
+ initial['project_id'] = project_id
@gabrielhurley
gabrielhurley / devstack_quantum_auth_failure.log
Created August 7, 2012 20:02
devstack quantum auth failure
+ /opt/stack/nova/bin/nova-manage network create private 10.0.0.0/24 1 256
2012-08-07 19:59:14 WARNING nova.network.quantum.manager [req-d60cdd7c-40f3-4041-87c1-64e3a3c75098 None None] QuantumManager does not use 'bridge' parameter.
QuantumManager does not use 'bridge' parameter.
2012-08-07 19:59:14 WARNING nova.network.quantum.manager [req-d60cdd7c-40f3-4041-87c1-64e3a3c75098 None None] QuantumManager does not use 'bridge_interface' parameter.
QuantumManager does not use 'bridge_interface' parameter.
2012-08-07 19:59:14 DEBUG nova.network.quantum.quantum_connection [req-d60cdd7c-40f3-4041-87c1-64e3a3c75098 None None] Quantum Client Request: POST /v1.1/tenants/default/networks.json from (pid=13521) do_request /opt/stack/nova/nova/network/quantum/client.py:182
Quantum Client Request: POST /v1.1/tenants/default/networks.json
2012-08-07 19:59:14 DEBUG nova.network.quantum.quantum_connection [req-d60cdd7c-40f3-4041-87c1-64e3a3c75098 None None] {"network": {"name": "private", "nova_id": "nova"}} from (pid=13521) d