diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index 7c21a9d9df..85deadcea0 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -736,9 +736,10 @@ class CIFSHelper(NASHelperBase): def create_export(self, server, share_name, recreate=False): """Create share at samba server.""" + share_path = os.path.join(self.configuration.share_mount_path, + share_name) create_cmd = [ - 'sudo', 'net', 'conf', 'addshare', - share_name, self.configuration.share_mount_path, + 'sudo', 'net', 'conf', 'addshare', share_name, share_path, 'writeable=y', 'guest_ok=y', ] try: diff --git a/manila/tests/share/drivers/test_generic.py b/manila/tests/share/drivers/test_generic.py index 61a065da4c..6795ea901a 100644 --- a/manila/tests/share/drivers/test_generic.py +++ b/manila/tests/share/drivers/test_generic.py @@ -921,6 +921,9 @@ class CIFSHelperTestCase(test.TestCase): expected_location = '//%s/%s' % ( self.server_details['public_address'], self.share_name) self.assertEqual(ret, expected_location) + share_path = os.path.join( + self._helper.configuration.share_mount_path, + self.share_name) self._helper._ssh_exec.assert_has_calls([ mock.call( self.server_details, @@ -930,8 +933,7 @@ class CIFSHelperTestCase(test.TestCase): self.server_details, [ 'sudo', 'net', 'conf', 'addshare', self.share_name, - self._helper.configuration.share_mount_path, - 'writeable=y', 'guest_ok=y', + share_path, 'writeable=y', 'guest_ok=y', ] ), mock.call(self.server_details, mock.ANY), @@ -943,6 +945,9 @@ class CIFSHelperTestCase(test.TestCase): expected_location = '//%s/%s' % ( self.server_details['public_address'], self.share_name) self.assertEqual(ret, expected_location) + share_path = os.path.join( + self._helper.configuration.share_mount_path, + self.share_name) self._helper._ssh_exec.assert_has_calls([ mock.call( self.server_details, @@ -956,8 +961,7 @@ class CIFSHelperTestCase(test.TestCase): self.server_details, [ 'sudo', 'net', 'conf', 'addshare', self.share_name, - self._helper.configuration.share_mount_path, - 'writeable=y', 'guest_ok=y', + share_path, 'writeable=y', 'guest_ok=y', ] ), mock.call(self.server_details, mock.ANY),