From 691f20ff7a825a35d3b3cd60dafd5c96e152a2cf Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Sun, 7 May 2017 01:19:21 -0300 Subject: [PATCH] [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 --- .../manila-lvm_location_logging.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 project_exercises_boston/manila-lvm_location_logging.patch diff --git a/project_exercises_boston/manila-lvm_location_logging.patch b/project_exercises_boston/manila-lvm_location_logging.patch new file mode 100644 index 000000000..c109bbde0 --- /dev/null +++ b/project_exercises_boston/manila-lvm_location_logging.patch @@ -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 +