soreana commented on code in PR #7417:
URL: https://github.com/apache/cloudstack/pull/7417#discussion_r1395721766
##########
utils/src/main/java/com/cloud/utils/FileUtil.java:
##########
@@ -57,4 +66,29 @@ public static void scpPatchFiles(String controlIp, String
destPath, int sshPort,
}
throw new CloudRuntimeException(finalErrMsg);
}
+
+ public static List<String> getFilesPathsUnderResourceDirectory(String
resourceDirectory) {
+ s_logger.info(String.format("Searching for files under resource
directory [%s].", resourceDirectory));
+
+ URL resourceDirectoryUrl =
Thread.currentThread().getContextClassLoader().getResource(resourceDirectory);
+ if (resourceDirectoryUrl == null) {
+ throw new CloudRuntimeException(String.format("Resource directory
[%s] does not exist or is empty.", resourceDirectory));
+ }
+
+ URI resourceDirectoryUri;
+ try {
+ resourceDirectoryUri = resourceDirectoryUrl.toURI();
+ } catch (URISyntaxException e) {
+ throw new CloudRuntimeException(String.format("Unable to get URI
from URL [%s].", resourceDirectoryUrl), e);
+ }
+
+ try (FileSystem fs = FileSystems.newFileSystem(resourceDirectoryUri,
Collections.emptyMap())) {
+ try (Stream<Path> paths =
Files.walk(fs.getPath(resourceDirectory))) {
+ return
paths.filter(Files::isRegularFile).map(Path::toString).collect(Collectors.toList());
Review Comment:
Can You please merge these two `try` blocks?
##########
engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java:
##########
@@ -364,6 +368,29 @@ protected void upgrade(CloudStackVersion dbVersion,
CloudStackVersion currentVer
}
}
updateSystemVmTemplates(upgrades);
+ executeViewScripts();
Review Comment:
Can you please switch line 370 and 371 so that the view upgrade happens
before updating the system VM template?
--
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]