diff --git a/src/middlewared/middlewared/plugins/activedirectory.py b/src/middlewared/middlewared/plugins/activedirectory.py index e34c78fbabfd..fc3227c78e48 100644 --- a/src/middlewared/middlewared/plugins/activedirectory.py +++ b/src/middlewared/middlewared/plugins/activedirectory.py @@ -71,7 +71,7 @@ class Config: Str('createcomputer'), NetbiosName('netbiosname'), NetbiosName('netbiosname_b'), - List('netbiosalias', items=[NetbiosName('alias')]), + List('netbiosalias', items=[NetbiosName('alias')], default=None), Bool('enable'), register=True ) @@ -122,6 +122,11 @@ async def nss_info_choices(self): @private async def update_netbios_data(self, old, new): must_update = False + + # None here as opposed to empty list indicates to preserve current value + if new['netbiosalias'] is None: + new['netbiosalias'] = old['netbiosalias'] + for key in ['netbiosname', 'netbiosalias']: # netbios names are case-insensitive if key in new and old[key] != new[key]: