Skip to content

Commit

Permalink
(plugin_updatenetworkcheck) Protect the file copy of
Browse files Browse the repository at this point in the history
medullanetnotify.exe in a try

(cherry picked from commit c199e1e)
  • Loading branch information
neoclust committed Apr 22, 2024
1 parent 2af27f8 commit e8e5b4b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pulse_xmpp_agent/pluginsmachine/plugin_updatenetworkcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,13 @@ def updatenetworkcheck(xmppobject):
querycmd_result = utils.simplecommand(querycmd)
# We need to have a copy of pythonservices named based on _exe_name_
if not os.path.isfile(os.path.join(win32_path, "medullanetnotify.exe")):
shutil.copyfile(
os.path.join(win32_path, "pythonservice.exe"),
os.path.join(win32_path, "medullanetnotify.exe"),
)
try:
shutil.copyfile(
os.path.join(win32_path, "pythonservice.exe"),
os.path.join(win32_path, "medullanetnotify.exe"),
)
except IOError as error_copy:
logger.error(f"The error {error_copy} \n occured while copying files")

if querycmd_result["code"] != 0:
servicecmd = '%s "%s\\%s" --startup=auto install' % (
Expand Down

0 comments on commit e8e5b4b

Please sign in to comment.