~tr3buchet/nova/lock

« back to all changes in this revision

Viewing changes to nova/service.py

  • Committer: Vishvananda Ishaya
  • Date: 2010-12-22 20:59:53 UTC
  • mto: This revision was merged to the branch mainline in revision 482.
  • Revision ID: vishvananda@gmail.com-20101222205953-j2j5t0qjwlcd0t2s
merge trunk and upgrade to cheetah templating

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
            report_interval = FLAGS.report_interval
152
152
        if not periodic_interval:
153
153
            periodic_interval = FLAGS.periodic_interval
154
 
        logging.warn("Starting %s node", topic)
 
154
        logging.warn(_("Starting %s node"), topic)
155
155
        service_obj = cls(host, binary, topic, manager,
156
156
                          report_interval, periodic_interval)
157
157
 
163
163
        try:
164
164
            db.service_destroy(context.get_admin_context(), self.service_id)
165
165
        except exception.NotFound:
166
 
            logging.warn("Service killed that has no database entry")
 
166
            logging.warn(_("Service killed that has no database entry"))
167
167
 
168
168
    def stop(self):
169
169
        for x in self.timers:
184
184
            try:
185
185
                service_ref = db.service_get(ctxt, self.service_id)
186
186
            except exception.NotFound:
187
 
                logging.debug("The service database object disappeared, "
188
 
                              "Recreating it.")
 
187
                logging.debug(_("The service database object disappeared, "
 
188
                                "Recreating it."))
189
189
                self._create_service_ref(ctxt)
190
190
                service_ref = db.service_get(ctxt, self.service_id)
191
191
 
196
196
            # TODO(termie): make this pattern be more elegant.
197
197
            if getattr(self, "model_disconnected", False):
198
198
                self.model_disconnected = False
199
 
                logging.error("Recovered model server connection!")
 
199
                logging.error(_("Recovered model server connection!"))
200
200
 
201
201
        # TODO(vish): this should probably only catch connection errors
202
202
        except Exception:  # pylint: disable-msg=W0702
203
203
            if not getattr(self, "model_disconnected", False):
204
204
                self.model_disconnected = True
205
 
                logging.exception("model server went away")
 
205
                logging.exception(_("model server went away"))
206
206
 
207
207
 
208
208
def serve(*services):
221
221
    else:
222
222
        logging.getLogger().setLevel(logging.WARNING)
223
223
 
224
 
    logging.debug("Full set of FLAGS:")
 
224
    logging.debug(_("Full set of FLAGS:"))
225
225
    for flag in FLAGS:
226
226
        logging.debug("%s : %s" % (flag, FLAGS.get(flag, None)))
227
227