Merge "Specify the correct Samba share path"
This commit is contained in:
commit
50c9ed8502
@ -736,9 +736,10 @@ class CIFSHelper(NASHelperBase):
|
|||||||
|
|
||||||
def create_export(self, server, share_name, recreate=False):
|
def create_export(self, server, share_name, recreate=False):
|
||||||
"""Create share at samba server."""
|
"""Create share at samba server."""
|
||||||
|
share_path = os.path.join(self.configuration.share_mount_path,
|
||||||
|
share_name)
|
||||||
create_cmd = [
|
create_cmd = [
|
||||||
'sudo', 'net', 'conf', 'addshare',
|
'sudo', 'net', 'conf', 'addshare', share_name, share_path,
|
||||||
share_name, self.configuration.share_mount_path,
|
|
||||||
'writeable=y', 'guest_ok=y',
|
'writeable=y', 'guest_ok=y',
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
|
@ -921,6 +921,9 @@ class CIFSHelperTestCase(test.TestCase):
|
|||||||
expected_location = '//%s/%s' % (
|
expected_location = '//%s/%s' % (
|
||||||
self.server_details['public_address'], self.share_name)
|
self.server_details['public_address'], self.share_name)
|
||||||
self.assertEqual(ret, expected_location)
|
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([
|
self._helper._ssh_exec.assert_has_calls([
|
||||||
mock.call(
|
mock.call(
|
||||||
self.server_details,
|
self.server_details,
|
||||||
@ -930,8 +933,7 @@ class CIFSHelperTestCase(test.TestCase):
|
|||||||
self.server_details,
|
self.server_details,
|
||||||
[
|
[
|
||||||
'sudo', 'net', 'conf', 'addshare', self.share_name,
|
'sudo', 'net', 'conf', 'addshare', self.share_name,
|
||||||
self._helper.configuration.share_mount_path,
|
share_path, 'writeable=y', 'guest_ok=y',
|
||||||
'writeable=y', 'guest_ok=y',
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
mock.call(self.server_details, mock.ANY),
|
mock.call(self.server_details, mock.ANY),
|
||||||
@ -943,6 +945,9 @@ class CIFSHelperTestCase(test.TestCase):
|
|||||||
expected_location = '//%s/%s' % (
|
expected_location = '//%s/%s' % (
|
||||||
self.server_details['public_address'], self.share_name)
|
self.server_details['public_address'], self.share_name)
|
||||||
self.assertEqual(ret, expected_location)
|
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([
|
self._helper._ssh_exec.assert_has_calls([
|
||||||
mock.call(
|
mock.call(
|
||||||
self.server_details,
|
self.server_details,
|
||||||
@ -956,8 +961,7 @@ class CIFSHelperTestCase(test.TestCase):
|
|||||||
self.server_details,
|
self.server_details,
|
||||||
[
|
[
|
||||||
'sudo', 'net', 'conf', 'addshare', self.share_name,
|
'sudo', 'net', 'conf', 'addshare', self.share_name,
|
||||||
self._helper.configuration.share_mount_path,
|
share_path, 'writeable=y', 'guest_ok=y',
|
||||||
'writeable=y', 'guest_ok=y',
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
mock.call(self.server_details, mock.ANY),
|
mock.call(self.server_details, mock.ANY),
|
||||||
|
Loading…
Reference in New Issue
Block a user