~nova-coresec/nova/bexar-translations

« back to all changes in this revision

Viewing changes to nova/compute/disk.py

  • Committer: Todd Willey
  • Date: 2011-01-04 05:23:35 UTC
  • mto: (515.6.1 newlog2)
  • mto: This revision was merged to the branch mainline in revision 528.
  • Revision ID: todd@ansolabs.com-20110104052335-rfq4igtasqjv3ux5
Apply logging changes as a giant patch to work around the cloudpipe delete + add issue in the original patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
"""
24
24
 
25
 
import logging
26
25
import os
27
26
import tempfile
28
27
 
29
28
from nova import exception
30
29
from nova import flags
31
 
 
32
 
 
 
30
from nova import log as logging
 
31
 
 
32
 
 
33
LOG = logging.getLogger('nova.compute.disk')
33
34
FLAGS = flags.FLAGS
34
35
flags.DEFINE_integer('minimum_root_size', 1024 * 1024 * 1024 * 10,
35
36
                     'minimum size in bytes of root partition')
67
68
        execute('resize2fs %s' % infile)
68
69
        file_size = FLAGS.minimum_root_size
69
70
    elif file_size % sector_size != 0:
70
 
        logging.warn(_("Input partition size not evenly divisible by"
71
 
                       " sector size: %d / %d"), file_size, sector_size)
 
71
        LOG.warn(_("Input partition size not evenly divisible by"
 
72
                   " sector size: %d / %d"), file_size, sector_size)
72
73
    primary_sectors = file_size / sector_size
73
74
    if local_bytes % sector_size != 0:
74
 
        logging.warn(_("Bytes for local storage not evenly divisible"
75
 
                       " by sector size: %d / %d"), local_bytes, sector_size)
 
75
        LOG.warn(_("Bytes for local storage not evenly divisible"
 
76
                   " by sector size: %d / %d"), local_bytes, sector_size)
76
77
    local_sectors = local_bytes / sector_size
77
78
 
78
79
    mbr_last = 62  # a