sandbox/project_exercises_boston/manila-lvm_location_logging...

35 lines
1.3 KiB
Diff

diff --git a/manila/share/drivers/lvm.py b/manila/share/drivers/lvm.py
index 5bc1e41..8093a99 100644
--- a/manila/share/drivers/lvm.py
+++ b/manila/share/drivers/lvm.py
@@ -27,8 +27,8 @@ from oslo_log import log
from oslo_utils import importutils
import six
-from manila import exception
from manila.i18n import _
+from manila import exception
from manila.share import driver
from manila.share.drivers import generic
from manila.share import utils
@@ -91,7 +91,7 @@ class LVMMixin(driver.ExecuteMixin):
self._try_execute(*cmd, run_as_root=True)
device_name = self._get_local_path(share)
self._execute('mkfs.%s' % self.configuration.share_volume_fstype,
- device_name, run_as_root=True)
+ device_name, run_as_root=False)
def _extend_container(self, share, device_name, size):
cmd = ['lvextend', '-L', '%sG' % size, '-n', device_name]
@@ -218,6 +218,10 @@ class LVMShareDriver(LVMMixin, driver.ShareDriver):
device_name = self._get_local_path(share)
location = self._get_helper(share).create_exports(
self.share_server, share['name'])
+
+ LOG.debug("Share location is %(export_location)s",
+ {"export_location": export_location})
+
self._mount_device(share, device_name)
return location