mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-01-08 05:17:54 +03:00
Added number attribute to scriptsini for incorrect paths
This commit is contained in:
parent
40635f9a01
commit
517ed6d56b
@ -142,7 +142,9 @@ def install_script(storage_script_entry, script_dir, access_permissions):
|
||||
'''
|
||||
dir_cr = Path(script_dir)
|
||||
dir_cr.mkdir(parents=True, exist_ok=True)
|
||||
script_name = str(int(storage_script_entry.number)).zfill(5) + '_' + os.path.basename(storage_script_entry.path)
|
||||
if storage_script_entry.number is None:
|
||||
return
|
||||
script_name = str(storage_script_entry.number).zfill(5) + '_' + os.path.basename(storage_script_entry.path)
|
||||
script_file = os.path.join(script_dir, script_name)
|
||||
shutil.copyfile(storage_script_entry.path, script_file)
|
||||
|
||||
|
@ -126,6 +126,7 @@ class Script(DynamicAttributes):
|
||||
self.action = action_upper
|
||||
self.path = os.path.join(script_dir, action_upper, script_filename.upper())
|
||||
if not os.path.isfile(self.path):
|
||||
self.number = None
|
||||
return None
|
||||
self.args = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user