sandbox/project_exercises_boston/cinder-lvm_log_message.patch
Jay S. Bryant f6416890b3 [upstream] improve the cinder project patch
The original patch didn't apply cleanly.  This
fixes that problem and makes it less likely to fail.

Change-Id: I59b11bd9ce12f1118e4ac56db66b01f4574074af
2017-05-05 13:58:50 -05:00

59 lines
1.9 KiB
Diff

From 4b9f15956439f90e01b333c5f8662fd54886a4b1 Mon Sep 17 00:00:00 2001
From: Ubuntu <ubuntu@upstream-training>
Date: Fri, 5 May 2017 18:55:42 +0000
Subject: [PATCH] Add logging in the LVM driver
This patch adds some logging to the create
path for the LVM driver.
---
cinder/volume/drivers/lvm.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py
index f0af9f3..01ffdaf 100644
--- a/cinder/volume/drivers/lvm.py
+++ b/cinder/volume/drivers/lvm.py
@@ -27,8 +27,8 @@ from oslo_utils import importutils
from oslo_utils import units
import six
-from cinder.brick.local_dev import lvm as lvm
from cinder import exception
+from cinder.brick.local_dev import lvm as lvm
from cinder.i18n import _
from cinder.image import image_utils
from cinder import interface
@@ -37,7 +37,7 @@ from cinder import utils
from cinder.volume import driver
from cinder.volume import utils as volutils
-LOG = logging.getLogger(__name__)
+LOG = logging.getLogger(__name__)
# FIXME(jdg): We'll put the lvm_ prefix back on these when we
# move over to using this as the real LVM driver, for now we'll
@@ -196,6 +196,8 @@ class LVMVolumeDriver(driver.VolumeDriver):
if vg is not None:
vg_ref = vg
+ LOG.debug("Size is %(size_value)s ",
+ {'size_value': sise})
vg_ref.create_volume(name, size, lvm_type, mirror_count)
def _update_volume_stats(self):
@@ -360,8 +362,10 @@ class LVMVolumeDriver(driver.VolumeDriver):
if self.configuration.lvm_mirrors:
mirror_count = self.configuration.lvm_mirrors
+ size = int(volume['size']) * 2
+
self._create_volume(volume['name'],
- self._sizestr(volume['size']),
+ self._sizestr(size),
self.configuration.lvm_type,
mirror_count)
--
2.7.4