Skip to content

Commit

Permalink
Fix crash when generating SMB configuration on standby
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Dec 24, 2024
1 parent 617f2b4 commit a34502d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/etc_files/local/smb4.conf.mako
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SMB.CONF(5) The configuration file for the Samba suite
#
<%
shares = render_ctx['smb.generate_smb_configuration'].pop('SHARES')
shares = render_ctx['smb.generate_smb_configuration'].pop('SHARES', [])
%>

[global]
Expand Down
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/plugins/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async def unixcharset_choices(self):
@private
def generate_smb_configuration(self):
if self.middleware.call_sync('failover.status') not in ('SINGLE', 'MASTER'):
return {'netbiosname': 'TN_STANDBY'}
return {'netbiosname': 'TN_STANDBY', 'SHARES': []}

if (ds_type := self.middleware.call_sync('directoryservices.status')['type']) is not None:
ds_type = DSType(ds_type)
Expand Down

0 comments on commit a34502d

Please sign in to comment.