~ubuntu-branches/ubuntu/precise/nova/precise

« back to all changes in this revision

Viewing changes to nova/virt/libvirt/connection.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-04-04 16:55:52 UTC
  • mfrom: (1.1.53)
  • Revision ID: package-import@ubuntu.com-20120404165552-qqbhkyo6b2hjw6ut
Tags: 2012.1~rc4-0ubuntu1
* New upstream release.
* debian/patches/nova-console-monitor.patch: Disabled.
* debian/nova.conf: Removed console-monitor option.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2292
2292
        """Manage the local cache of images."""
2293
2293
        self.image_cache_manager.verify_base_images(context)
2294
2294
 
2295
 
    def monitor_console_log(self, instance):
2296
 
        console_log_file = os.path.join(FLAGS.instances_path,
2297
 
                                   instance['name'],
2298
 
                                   'console.log')
2299
 
        if os.path.exists(console_log_file):
2300
 
            stat = os.stat(console_log_file)
2301
 
            if stat.st_size >= FLAGS.console_threshold_size:
2302
 
                size = stat.st_size
2303
 
                file_acess_time = stat.st_mtime
2304
 
                LOG.warn(_('console.log size: %(size)s bytes, '
2305
 
                           'last accessed: %(file_acess_time)s.')
2306
 
                         % locals(), instance=instance)
2307
 
                if FLAGS.console_monitor_truncate:
2308
 
                    LOG.warn(_('Truncating console.log for %s.'),
2309
 
                                instance['name'])
2310
 
                    utils.execute('truncate',
2311
 
                                  '--size=%s' % FLAGS.console_threshold_size,
2312
 
                                  console_log_file)
2313
 
                    libvirt_utils.chown(console_log_fle, os.getuid())
2314
 
                else:
2315
 
                    LOG.warn(_('Truncate console.log not set.'))
2316
 
 
2317
2295
    @exception.wrap_exception()
2318
2296
    def migrate_disk_and_power_off(self, context, instance, dest,
2319
2297
                                   instance_type, network_info):