diff options
| author | Ewan Mellor <ewan.mellor@citrix.com> | 2010-07-25 15:11:20 +0100 |
|---|---|---|
| committer | Ewan Mellor <ewan.mellor@citrix.com> | 2010-07-25 15:11:20 +0100 |
| commit | 605bfc4990a67aae4a644f961cd881461d09cf2f (patch) | |
| tree | f0b3cab1ef15789ee1c06ef8d5c5cedff8196a71 | |
| parent | b2d769cb92dce5be26288c8e389491cf554b5703 (diff) | |
| parent | 1a53eaeed901f3c789ebdb867b73996ccac608c3 (diff) | |
| download | nova-605bfc4990a67aae4a644f961cd881461d09cf2f.tar.gz nova-605bfc4990a67aae4a644f961cd881461d09cf2f.tar.xz nova-605bfc4990a67aae4a644f961cd881461d09cf2f.zip | |
Merge ~ewanmellor/nova/lp609749.
| -rw-r--r-- | README | 14 | ||||
| -rw-r--r-- | nova/process.py | 13 | ||||
| -rw-r--r-- | nova/tests/network_unittest.py | 2 | ||||
| -rw-r--r-- | nova/tests/process_unittest.py | 7 |
4 files changed, 23 insertions, 13 deletions
@@ -6,15 +6,19 @@ The Choose Your Own Adventure README for Nova: 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 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 diff --git a/nova/process.py b/nova/process.py index d3558ed2e..8ecef1584 100644 --- a/nova/process.py +++ b/nova/process.py @@ -205,13 +205,12 @@ class ProcessPool(object): self._pool.release() return rv -class SharedPool(ProcessPool): - _instance = None - def __new__(cls, *args, **kwargs): - if not cls._instance: - cls._instance = super(SharedPool, cls).__new__( - cls, *args, **kwargs) - return cls._instance +_instance = None +def SharedPool(): + global _instance + if _instance is None: + _instance = ProcessPool() + return _instance def simple_execute(cmd, **kwargs): return SharedPool().simple_execute(cmd, **kwargs) diff --git a/nova/tests/network_unittest.py b/nova/tests/network_unittest.py index 98568aeae..69278e896 100644 --- a/nova/tests/network_unittest.py +++ b/nova/tests/network_unittest.py @@ -137,7 +137,7 @@ class NetworkTestCase(test.TrialTestCase): self.dnsmasq.release_ip(mac3, address3, hostname, net.bridge_name) net = network.get_project_network("project0", "default") 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): pass diff --git a/nova/tests/process_unittest.py b/nova/tests/process_unittest.py index 1c15b69a0..c96bb5913 100644 --- a/nova/tests/process_unittest.py +++ b/nova/tests/process_unittest.py @@ -120,3 +120,10 @@ class ProcessTestCase(test.TrialTestCase): pool2 = process.SharedPool() 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 |
