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

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

weizhouapache commented on code in PR #7779:
URL: https://github.com/apache/cloudstack/pull/7779#discussion_r1276014878


##########
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:
   yes, 
   it will then create a new file `/etc/sysconfig/libvirtd` with content `LIBVIRTD_ARGS=-l`



-- 
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