From 5e40e99b4ac2ec97fe227d16f65fae8305e143ce Mon Sep 17 00:00:00 2001 From: Trey Morris Date: Fri, 10 Dec 2010 16:28:23 +0000 Subject: [PATCH 1/2] added unittest for pause --- nova/tests/compute_unittest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nova/tests/compute_unittest.py b/nova/tests/compute_unittest.py index 6f3ef96c..ad191795 100644 --- a/nova/tests/compute_unittest.py +++ b/nova/tests/compute_unittest.py @@ -138,6 +138,15 @@ class ComputeTestCase(test.TrialTestCase): yield self.compute.reboot_instance(self.context, instance_id) yield self.compute.terminate_instance(self.context, instance_id) + @defer.inlineCallbacks + def test_pause(self): + """Ensure instance can be paused""" + instance_id = self._create_instance() + yield self.compute.run_instance(self.context, instance_id) + yield self.compute.pause_instance(self.context, instance_id) + yield self.compute.unpause_instance(self.context, instance_id) + yield self.compute.terminate_instance(self.context, instance_id) + @defer.inlineCallbacks def test_console_output(self): """Make sure we can get console output from instance""" From 39b82d7804d6a7f1e65172f3c898982d5b0e7360 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Tue, 14 Dec 2010 17:56:42 -0400 Subject: [PATCH 2/2] pep8 --- nova/adminclient.py | 1 + nova/process.py | 2 ++ nova/server.py | 2 +- nova/twistd.py | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nova/adminclient.py b/nova/adminclient.py index 5a62cce7..6ae9f0c0 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -194,6 +194,7 @@ class HostInfo(object): class NovaAdminClient(object): + def __init__( self, clc_url=DEFAULT_CLC_URL, diff --git a/nova/process.py b/nova/process.py index b33df048..39fddef6 100644 --- a/nova/process.py +++ b/nova/process.py @@ -40,6 +40,8 @@ flags.DEFINE_integer('process_pool_size', 4, # This is based on _BackRelay from twister.internal.utils, but modified to # capture both stdout and stderr, without odd stderr handling, and also to # handle stdin + + class BackRelayWithInput(protocol.ProcessProtocol): """ Trivial protocol for communicating with a process and turning its output diff --git a/nova/server.py b/nova/server.py index a0ee5468..3b908617 100644 --- a/nova/server.py +++ b/nova/server.py @@ -42,7 +42,7 @@ flags.DEFINE_bool('daemonize', False, 'daemonize this process') # clutter. flags.DEFINE_bool('use_syslog', True, 'output to syslog when daemonizing') flags.DEFINE_string('logfile', None, 'log file to output to') -flags.DEFINE_string('logdir', None, 'directory to keep log files in ' +flags.DEFINE_string('logdir', None, 'directory to keep log files in ' '(will be prepended to $logfile)') flags.DEFINE_string('pidfile', None, 'pid file to output to') flags.DEFINE_string('working_directory', './', 'working directory...') diff --git a/nova/twistd.py b/nova/twistd.py index cb5648ce..e6c3101f 100644 --- a/nova/twistd.py +++ b/nova/twistd.py @@ -43,7 +43,7 @@ else: FLAGS = flags.FLAGS -flags.DEFINE_string('logdir', None, 'directory to keep log files in ' +flags.DEFINE_string('logdir', None, 'directory to keep log files in ' '(will be prepended to $logfile)')