Skip to content

Instantly share code, notes, and snippets.

@kahou82
kahou82 / limits.py
Created November 19, 2014 22:17
Patch for getting usage from nova
class LimitsController(object):
"""Controller for accessing limits in the OpenStack API."""
@wsgi.serializers(xml=LimitsTemplate)
def index(self, req):
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
"""Return all global and rate limit information."""
context = req.environ['nova.context']
diff --git a/nova/api/openstack/compute/limits.py b/nova/api/openstack/compute/limits.py
index 07e7913..481cf14 100644
--- a/nova/api/openstack/compute/limits.py
+++ b/nova/api/openstack/compute/limits.py
@@ -79,14 +79,38 @@ class LimitsController(object):
@wsgi.serializers(xml=LimitsTemplate)
def index(self, req):
+ from nova.openstack.common import log as logging
+ LOG = logging.getLogger(__name__)
var horizon_dependencies = ['hz.conf', 'hz.utils', 'ngCookies', 'hz.table'];
dependencies = horizon_dependencies.concat(angularModuleExtension);
var horizonApp = angular.module('hz', dependencies)
.provider('unicornLauncher', function UnicornLauncherProvider() {
var useTinfoilShielding = false;
this.injectSomething = function() {
var temp = horizon.conf.spinner_options; // this provider relates on horizon.conf.spinner_options which is not initialzied during config
};
@kahou82
kahou82 / ceph.py
Created May 14, 2015 18:01
Nova extensions
# Put this under nova/api/openstack/compute/contrib/
from nova.api.openstack import extensions
CEPH_DATA = [{'id': 1,
'type': 'type1'},
{'id': 2,
'type': 'type2'},
]
{
"context_is_admin": "role:admin",
"admin_or_owner": "rule:context_is_admin or tenant_id:%(tenant_id)s",
"admin_or_network_owner": "rule:context_is_admin or tenant_id:%(network:tenant_id)s",
"admin_only": "rule:context_is_admin",
"regular_user": "",
"shared": "field:networks:shared=True",
"shared_firewalls": "field:firewalls:shared=True",
"external": "field:networks:router:external=True",
"default": "rule:admin_or_owner",
class Metapod(utils.NeutronScenario,
vm_utils.VMScenario,
nova_utils.NovaScenario
):
@types.set(image=types.ImageResourceType,
flavor=types.FlavorResourceType)
@validation.required_services(consts.Service.NOVA)
@validation.required_services(consts.Service.NEUTRON)
@validation.image_valid_on_flavor("flavor", "image")
--- trunk/includes/role/openstack/icehouse/2014.1.3.x/neutron-common/single/overlay/etc/neutron/neutron.conf.tt (revision 7347)
+++ trunk/includes/role/openstack/icehouse/2014.1.3.x/neutron-common/single/overlay/etc/neutron/neutron.conf.tt (working copy)
@@ -9,8 +9,25 @@
SWITCH mode;
CASE 'asr';
SET openatack.neutron.service_plugins = 'neutron.plugins.cisco.service_plugins.asr_cisco_router_plugin.PhysicalCiscoRouterPlugin';
+ SET openatack.neutron.service_plugins = '';
+ SET openstack.neutron.default_quota = -1;
+ SET openstack.neutron.quota_network = 5;
+ SET openstack.neutron.quota_subnet = 5;
# TODO:
# -Get xvnc working
# NOTE:
# Common config now lives in local.conf.common
[[local|localrc]]
disable_service n-obj
disable_service n-xvnc
disable_service tempest
disable_service n-net
enable_service mcapi
from metacloud import patcher
from openstack_dashboard.test import helpers as test
class TestUpstreamCode(test.TestCase):
def test_cypto_verifier(self):
patcher.verify_crypto_signatures_direct(
'openstack_dashboard.dashboards.project.volumes.volumes.forms',
'CreateForm.availability_zones',
'5540aa9f935ea07409ea50a688660259'
)