1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Simplify Networkshare initialization with username

This commit is contained in:
Evgeny Sinelnikov 2022-12-11 12:01:07 +04:00
parent abcc660118
commit aea8f6ed0a
2 changed files with 2 additions and 8 deletions

View File

@ -33,10 +33,7 @@ class Networkshare:
self.net_cmd_check = ['/usr/bin/net', 'usershare', 'list']
self.cmd = list()
self.name = networkshare_obj.name
if username:
self.path = expand_windows_var(networkshare_obj.path, username).replace('\\', '/') if networkshare_obj.path else None
else:
self.path = expand_windows_var(networkshare_obj.path).replace('\\', '/') if networkshare_obj.path else None
self.path = expand_windows_var(networkshare_obj.path, username).replace('\\', '/') if networkshare_obj.path else None
self.action = action_letter2enum(networkshare_obj.action)
self.allRegular = networkshare_obj.allRegular

View File

@ -39,10 +39,7 @@ class networkshare_applier(applier_frontend):
def run(self):
for networkshare in self.networkshare_info:
if self.username:
Networkshare(networkshare, self.username)
else:
Networkshare(networkshare)
Networkshare(networkshare, self.username)
def apply(self):
if self.__module_enabled: