Merge "Specify the correct Samba share path"

This commit is contained in:
Jenkins 2014-09-26 14:04:30 +00:00 committed by Gerrit Code Review
commit 50c9ed8502
2 changed files with 11 additions and 6 deletions

View File

@ -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:

View File

@ -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),