VR: fix duplicated lines in .htaccess (#10254)

This commit is contained in:
Wei Zhou 2025-02-14 14:57:48 +01:00 committed by GitHub
parent 5204960bac
commit 789f94b664
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -932,6 +932,7 @@ class CsVmMetadata(CsDataBag):
if os.path.exists(htaccessFile):
fh = open(htaccessFile, "a+")
self.__exflock(fh)
fh.seek(0)
if entry not in fh.read():
fh.write(entry + '\n')
self.__unflock(fh)
@ -969,6 +970,7 @@ class CsVmMetadata(CsDataBag):
fh = open(htaccessFile, "a+")
self.__exflock(fh)
fh.seek(0)
if entry not in fh.read():
fh.write(entry + '\n')