[upstream] Add patch for Manila deep dive exercise

This change adds a patch that will be used to practice
debugging in Manila for the Upstream Training in Boston.

Students should pull the patch file down and apply it to
a branch in their local Manila repository.

Change-Id: I3f59a155def3c30739384b68933c7f32e15ec24b
This commit is contained in:
Victoria Martinez de la Cruz 2017-05-07 01:19:21 -03:00
parent f6416890b3
commit 691f20ff7a

View File

@ -0,0 +1,34 @@
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