weizhouapache commented on code in PR #10254:
URL: https://github.com/apache/cloudstack/pull/10254#discussion_r1926962746
##########
systemvm/debian/opt/cloud/bin/configure.py:
##########
@@ -932,6 +932,7 @@ def __htaccess(self, ip, folder, file):
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')
Review Comment:
@DaanHoogland
the issue is because fh.read() is empty.
I have no idea why 4.19 does not have the issue, probably because of python3
upgrade.
`fh.seek(0)` moves the file cursor to the beginning of the file so that
`fh.read()` will read the content of the file.
the write operation is not changed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]