Merge ~ewanmellor/nova/lp609749.
This commit is contained in:
14
README
14
README
@@ -6,15 +6,19 @@ The Choose Your Own Adventure README for Nova:
|
|||||||
|
|
||||||
To monitor it from a distance: follow @novacc on twitter
|
To monitor it from a distance: follow @novacc on twitter
|
||||||
|
|
||||||
To tame it for use in your own cloud: read http://docs.novacc.org/getting.started.html
|
To tame it for use in your own cloud: read http://nova.openstack.org/getting.started.html
|
||||||
|
|
||||||
To study its anatomy: read http://docs.novacc.org/architecture.html
|
To study its anatomy: read http://nova.openstack.org/architecture.html
|
||||||
|
|
||||||
To disect it in detail: visit http://github.com/nova/cc
|
To disect it in detail: visit http://code.launchpad.net/nova
|
||||||
|
|
||||||
To taunt it with its weaknesses: use http://github.com/nova/cc/issues
|
To taunt it with its weaknesses: use http://bugs.launchpad.net/nova
|
||||||
|
|
||||||
|
To watch it: http://hudson.openstack.org
|
||||||
|
|
||||||
To hack at it: read HACKING
|
To hack at it: read HACKING
|
||||||
|
|
||||||
To watch it: http://test.novacc.org/waterfall
|
To laugh at its PEP8 problems: http://hudson.openstack.org/job/nova-pep8/violations
|
||||||
|
|
||||||
|
To cry over its pylint problems: http://hudson.openstack.org/job/nova-pylint/violations
|
||||||
|
|
||||||
|
|||||||
@@ -205,13 +205,12 @@ class ProcessPool(object):
|
|||||||
self._pool.release()
|
self._pool.release()
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
class SharedPool(ProcessPool):
|
|
||||||
_instance = None
|
_instance = None
|
||||||
def __new__(cls, *args, **kwargs):
|
def SharedPool():
|
||||||
if not cls._instance:
|
global _instance
|
||||||
cls._instance = super(SharedPool, cls).__new__(
|
if _instance is None:
|
||||||
cls, *args, **kwargs)
|
_instance = ProcessPool()
|
||||||
return cls._instance
|
return _instance
|
||||||
|
|
||||||
def simple_execute(cmd, **kwargs):
|
def simple_execute(cmd, **kwargs):
|
||||||
return SharedPool().simple_execute(cmd, **kwargs)
|
return SharedPool().simple_execute(cmd, **kwargs)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class NetworkTestCase(test.TrialTestCase):
|
|||||||
self.dnsmasq.release_ip(mac3, address3, hostname, net.bridge_name)
|
self.dnsmasq.release_ip(mac3, address3, hostname, net.bridge_name)
|
||||||
net = network.get_project_network("project0", "default")
|
net = network.get_project_network("project0", "default")
|
||||||
rv = network.deallocate_ip(secondaddress)
|
rv = network.deallocate_ip(secondaddress)
|
||||||
self.dnsmasq.release_ip(mac, address, hostname, net.bridge_name)
|
self.dnsmasq.release_ip(mac, secondaddress, hostname, net.bridge_name)
|
||||||
|
|
||||||
def test_release_before_deallocate(self):
|
def test_release_before_deallocate(self):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -120,3 +120,10 @@ class ProcessTestCase(test.TrialTestCase):
|
|||||||
pool2 = process.SharedPool()
|
pool2 = process.SharedPool()
|
||||||
self.assert_(id(pool1) == id(pool2))
|
self.assert_(id(pool1) == id(pool2))
|
||||||
|
|
||||||
|
def test_shared_pool_works_as_singleton(self):
|
||||||
|
d1 = process.simple_execute('sleep 1')
|
||||||
|
d2 = process.simple_execute('sleep 0.005')
|
||||||
|
# lp609749: would have failed with
|
||||||
|
# exceptions.AssertionError: Someone released me too many times:
|
||||||
|
# too many tokens!
|
||||||
|
return d1
|
||||||
|
|||||||
Reference in New Issue
Block a user