Copilot commented on code in PR #9969:
URL: https://github.com/apache/cloudstack/pull/9969#discussion_r2128427357


##########
setup/bindir/cloud-setup-databases.in:
##########
@@ -470,6 +486,8 @@ for example:
               self.encryptionJarPath = self.options.encryptionJarPath
             if self.options.mysqlbinpath:
               self.mysqlBinPath = self.options.mysqlbinpath
+            if self.options.skipUsersAutoCreation:
+                self.skipUsersAutoCreation = self.options.skipUsersAutoCreation

Review Comment:
   [nitpick] The flag is checked in multiple locations; consider consolidating 
the handling of skipUsersAutoCreation to ensure consistency and reduce 
potential duplication of logic.
   ```suggestion
               self.handleSkipUsersAutoCreation()
   ```



##########
setup/bindir/cloud-setup-databases.in:
##########
@@ -227,6 +241,8 @@ for full help
             p = os.path.join(self.dbFilesPath,"%s.sql"%f)
             if not os.path.exists(p): continue
             text = open(p).read()
+            if self.options.skipUsersAutoCreation:
+                for t, r in queriesToSkip: text = text.replace(t,r)
             for t, r in replacements: text = text.replace(t,r)

Review Comment:
   [nitpick] Consider extracting the query replacement logic (lines 244-245) 
into a separate function or adding more descriptive inline comments to clarify 
its intent, which could improve readability and maintainability.
   ```suggestion
               text = self.apply_replacements(text, queriesToSkip, 
replacements, self.options.skipUsersAutoCreation)
   ```



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

Reply via email to