You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2023/07/27 08:44:30 UTC

[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7779: cloudutils: fix adding rocky9 host failure due to missing /etc/sysconfig/libvirtd

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 , @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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org