summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChiradeep Vittal <chiradeep@chiradeep-lt2>2010-10-08 17:57:13 -0700
committerChiradeep Vittal <chiradeep@chiradeep-lt2>2010-10-08 17:57:13 -0700
commit8e28dd8331f99223696ab6656cd555be12c28e85 (patch)
tree263b5043c4c59291be42b238ff2553336f31a6a3
parentba4cafcdf5db5da1f8d7f717172bdba0fbac4353 (diff)
Twisted pidfile and other flag parameters simply do not function on Windows.
-rw-r--r--nova/twistd.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/nova/twistd.py b/nova/twistd.py
index 9511c231c..29d753283 100644
--- a/nova/twistd.py
+++ b/nova/twistd.py
@@ -224,21 +224,22 @@ def serve(filename):
logging.getLogger('amqplib').setLevel(logging.WARN)
FLAGS.python = filename
FLAGS.no_save = True
- if not FLAGS.pidfile:
- FLAGS.pidfile = '%s.pid' % name
- elif FLAGS.pidfile.endswith('twistd.pid'):
- 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:
- FLAGS.logfile = '%s.log' % name
- elif FLAGS.logfile.endswith('twistd.log'):
- FLAGS.logfile = FLAGS.logfile.replace('twistd.log', '%s.log' % name)
- if not FLAGS.prefix:
- FLAGS.prefix = name
- elif FLAGS.prefix.endswith('twisted'):
- FLAGS.prefix = FLAGS.prefix.replace('twisted', name)
+ if sys.platform != 'win32':
+ if not FLAGS.pidfile:
+ FLAGS.pidfile = '%s.pid' % name
+ elif FLAGS.pidfile.endswith('twistd.pid'):
+ 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:
+ FLAGS.logfile = '%s.log' % name
+ elif FLAGS.logfile.endswith('twistd.log'):
+ FLAGS.logfile = FLAGS.logfile.replace('twistd.log', '%s.log' % name)
+ if not FLAGS.prefix:
+ FLAGS.prefix = name
+ elif FLAGS.prefix.endswith('twisted'):
+ FLAGS.prefix = FLAGS.prefix.replace('twisted', name)
action = 'start'
if len(argv) > 1: