Skip to content

Instantly share code, notes, and snippets.

View vishvananda's full-sized avatar

Vish (Ishaya) Abrams vishvananda

  • Heroku
  • United States
View GitHub Profile
@vishvananda
vishvananda / devstack.rb
Created October 18, 2011 23:17
Vagrant script for devstack
Vagrant::Config.run do |config|
sshdir = "#{ENV['HOME']}/.ssh/"
cachedir = (ENV['CACHEDIR'] or "#{ENV['HOME']}/cache/")
checkout = (ENV['COOKBOOKS'] or "#{ENV['HOME']}/openstack-cookbooks")
ip_prefix = (ENV['IP_PREFIX'] or "192.168.27.")
mac_prefix = (ENV['MAC_PREFIX'] or "080027027")
suffix = "100"
ip = "#{ip_prefix}#{suffix}"
config.vm.box = "oneiric"
config.vm.box_url = "http://images.ansolabs.com/vagrant/oneiric64.box"
commit 7ac94ccf7dbb5838ef877b9d954ea96bf1412b4b
Author: Anthony Young <sleepsonthefloor@gmail.com>
Date: Mon Sep 12 00:16:49 2011 -0700
fix for lp847604 to unbreak instance rebooting
diff --git a/nova/compute/api.py b/nova/compute/api.py
index b0ea044..48bb266 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
diff --git a/nova/scheduler/simple.py b/nova/scheduler/simple.py
index fc1b314..b6cbff4 100644
--- a/nova/scheduler/simple.py
+++ b/nova/scheduler/simple.py
@@ -42,10 +42,13 @@ class SimpleScheduler(chance.ChanceScheduler):
def _schedule_instance(self, context, instance_id, *_args, **_kwargs):
"""Picks a host that is up and has the fewest running instances."""
instance_ref = db.instance_get(context, instance_id)
- if (instance_ref['availability_zone']
- and ':' in instance_ref['availability_zone']
diff --git a/nova/context.py b/nova/context.py
index de5b791..7f08877 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -1,5 +1,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
+# Copyright 2011 OpenStack LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
diff --git a/nova/tests/fake_flags.py b/nova/tests/fake_flags.py
index 0732164..7d37960 100644
--- a/nova/tests/fake_flags.py
+++ b/nova/tests/fake_flags.py
@@ -23,7 +23,8 @@ FLAGS = flags.FLAGS
flags.DECLARE('volume_driver', 'nova.volume.manager')
FLAGS['volume_driver'].SetDefault('nova.volume.driver.FakeISCSIDriver')
FLAGS['connection_type'].SetDefault('fake')
-FLAGS['fake_rabbit'].SetDefault(True)
+FLAGS['fake_rabbit'].SetDefault(False)
@vishvananda
vishvananda / azmanager.py
Created November 23, 2011 21:03
Availability Zone network manager
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
diff --git a/nova/compute/api.py b/nova/compute/api.py
index f65b5ce..01f5488 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -29,6 +29,7 @@ from nova import flags
import nova.image
from nova import log as logging
from nova import network
+from nova import policy
from nova import quota
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 83a0222..bcb0574 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -3876,18 +3876,21 @@ def sm_backend_conf_create(context, values):
@require_admin_context
def sm_backend_conf_update(context, sm_backend_id, values):
- backend_conf = model_query(context, models.SMBackendConf,
- read_deleted="yes").\
diff --git a/nova/api/openstack/compute/contrib/volumes.py b/nova/api/openstack/compute/contrib/volumes.py
index 6d01100..e235ad0 100644
--- a/nova/api/openstack/compute/contrib/volumes.py
+++ b/nova/api/openstack/compute/contrib/volumes.py
@@ -517,18 +517,20 @@ class SnapshotController(object):
snapshot = body['snapshot']
volume_id = snapshot['volume_id']
+ volume = self.volume_api.get(context, volume_id)
+
diff --git a/horizon/horizon/api/nova.py b/horizon/horizon/api/nova.py
index 3bf4a86..1937843 100644
--- a/horizon/horizon/api/nova.py
+++ b/horizon/horizon/api/nova.py
@@ -190,6 +190,18 @@ def novaclient(request):
return c
+def cinderclient(request):
+ LOG.debug('cinderclient connection created using token "%s" and url "%s"' %