File 0001-Generic-driver-Fix-unexport-handling-for-nfs-utils-1.patch of Package openstack-manila

From 9c84cedc68ea7aaed12f0a64a888a05ae4031729 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Thu, 18 Feb 2016 21:18:36 +0100
Subject: [PATCH] Generic driver: Fix unexport handling for nfs-utils 1.3.3

Executing exportfs -u without specifying the access list is no
longer possible, it requires the exact access list to be matching
otherwise

    exportfs: Invalid export syntax: <path>

is returned. As access list information is not available and
the maintenance mode is only temporary, just unexport everthing,
as it will be restored afterwards.

Change-Id: I8ebbba65ddc3dbb4e2014f3de946da3a5ce01c20
---
 manila/share/drivers/helpers.py            | 2 +-
 manila/tests/share/drivers/test_helpers.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: manila-2.0.1.dev38/manila/share/drivers/helpers.py
===================================================================
--- manila-2.0.1.dev38.orig/manila/share/drivers/helpers.py
+++ manila-2.0.1.dev38/manila/share/drivers/helpers.py
@@ -297,7 +297,7 @@ class NFSHelper(NASHelperBase):
 
         local_path = os.path.join(self.configuration.share_mount_path,
                                   share_name)
-        self._ssh_exec(server, ['sudo', 'exportfs', '-u', local_path])
+        self._ssh_exec(server, ['sudo', 'exportfs', '-ua'])
         self._sync_nfs_temp_and_perm_files(server)
 
     @nfs_synchronized
Index: manila-2.0.1.dev38/manila/tests/share/drivers/test_helpers.py
===================================================================
--- manila-2.0.1.dev38.orig/manila/tests/share/drivers/test_helpers.py
+++ manila-2.0.1.dev38/manila/tests/share/drivers/test_helpers.py
@@ -246,7 +246,7 @@ class NFSHelperTestCase(test.TestCase):
         )
         self._helper._ssh_exec.assert_any_call(
             self.server,
-            ['sudo', 'exportfs', '-u', share_mount_path]
+            ['sudo', 'exportfs', '-ua']
         )
         self._helper._sync_nfs_temp_and_perm_files.assert_called_once_with(
             self.server
openSUSE Build Service is sponsored by