Merged with trunk, added note about suspicious behaviour

This commit is contained in:
Justin Santa Barbara
2010-07-30 12:13:20 -07:00
5 changed files with 9 additions and 10 deletions

View File

@@ -21,8 +21,6 @@
Twisted daemon for nova objectstore. Supports S3 API. Twisted daemon for nova objectstore. Supports S3 API.
""" """
import logging
from nova import flags from nova import flags
from nova import utils from nova import utils
from nova import twistd from nova import twistd
@@ -33,9 +31,6 @@ FLAGS = flags.FLAGS
def main(): def main():
# FIXME: if this log statement isn't here, no logging
# appears from other files and app won't start daemonized
logging.debug('Started HTTP server on %s' % (FLAGS.s3_port))
app = handler.get_application() app = handler.get_application()
print app print app
return app return app

View File

@@ -34,7 +34,7 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
@@ -48,7 +48,7 @@ import hashlib
import hmac import hmac
import logging import logging
import urllib import urllib
import boto.utils import boto
from nova.exception import Error from nova.exception import Error

View File

@@ -21,10 +21,8 @@ Proxy AMI-related calls from the cloud controller, to the running
objectstore daemon. objectstore daemon.
""" """
import boto import boto.s3.connection
import boto.s3
import json import json
import random
import urllib import urllib
from nova import flags from nova import flags

View File

@@ -107,6 +107,9 @@ class BackRelayWithInput(protocol.ProcessProtocol):
reason.trap(error.ProcessDone) reason.trap(error.ProcessDone)
self.deferred.callback((stdout, stderr)) self.deferred.callback((stdout, stderr))
except: except:
# This logic is a little suspicious to me (justinsb)...
# If the callback throws an exception, then errback will be called also.
# However, this is what the unit tests test for...
self.deferred.errback(UnexpectedErrorOutput(stdout, stderr)) self.deferred.errback(UnexpectedErrorOutput(stdout, stderr))
elif self.onProcessEnded is not None: elif self.onProcessEnded is not None:
self.onProcessEnded.errback(reason) self.onProcessEnded.errback(reason)

View File

@@ -214,6 +214,9 @@ def serve(filename):
FLAGS.pidfile = '%s.pid' % name FLAGS.pidfile = '%s.pid' % name
elif FLAGS.pidfile.endswith('twistd.pid'): elif FLAGS.pidfile.endswith('twistd.pid'):
FLAGS.pidfile = FLAGS.pidfile.replace('twistd.pid', '%s.pid' % name) FLAGS.pidfile = FLAGS.pidfile.replace('twistd.pid', '%s.pid' % name)
# NOTE(vish): if we're running nodaemon, redirect the log to stdout
if FLAGS.nodaemon and not FLAGS.logfile:
FLAGS.logfile = "-"
if not FLAGS.logfile: if not FLAGS.logfile:
FLAGS.logfile = '%s.log' % name FLAGS.logfile = '%s.log' % name
elif FLAGS.logfile.endswith('twistd.log'): elif FLAGS.logfile.endswith('twistd.log'):