DaanHoogland commented on code in PR #7779:
URL: https://github.com/apache/cloudstack/pull/7779#discussion_r1275939340
##########
python/lib/cloudutils/configFileOps.py:
##########
@@ -59,39 +60,42 @@ def getEntry(self, name, separator="="):
return ""
def save(self):
- fp = open(self.fileName, "r")
newLines = []
- for line in fp.readlines():
- matched = False
- for entry in self.entries:
- if entry.op == "add":
- if entry.separator == "=":
- matchString = "^\ *" + entry.name + ".*"
- elif entry.separator == " ":
- matchString = "^\ *" + entry.name + "\ *" + entry.value
- else:
- if entry.separator == "=":
- matchString = "^\ *" + entry.name + "\ *=\ *" +
entry.value
+ if os.path.exists(self.fileName) and os.path.isfile(self.fileName):
Review Comment:
So can we safely do without the libvirtd sysconfig file if it doesn't exist,
@weizhouapache ?
--
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]