mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
VR: fix duplicated lines in .htaccess (#10254)
This commit is contained in:
parent
5204960bac
commit
789f94b664
@ -932,6 +932,7 @@ class CsVmMetadata(CsDataBag):
|
|||||||
if os.path.exists(htaccessFile):
|
if os.path.exists(htaccessFile):
|
||||||
fh = open(htaccessFile, "a+")
|
fh = open(htaccessFile, "a+")
|
||||||
self.__exflock(fh)
|
self.__exflock(fh)
|
||||||
|
fh.seek(0)
|
||||||
if entry not in fh.read():
|
if entry not in fh.read():
|
||||||
fh.write(entry + '\n')
|
fh.write(entry + '\n')
|
||||||
self.__unflock(fh)
|
self.__unflock(fh)
|
||||||
@ -969,6 +970,7 @@ class CsVmMetadata(CsDataBag):
|
|||||||
|
|
||||||
fh = open(htaccessFile, "a+")
|
fh = open(htaccessFile, "a+")
|
||||||
self.__exflock(fh)
|
self.__exflock(fh)
|
||||||
|
fh.seek(0)
|
||||||
if entry not in fh.read():
|
if entry not in fh.read():
|
||||||
fh.write(entry + '\n')
|
fh.write(entry + '\n')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user