harikrishna-patnala commented on code in PR #7799:
URL: https://github.com/apache/cloudstack/pull/7799#discussion_r1281559825
##########
engine/schema/src/main/java/com/cloud/upgrade/GuestOsMapper.java:
##########
@@ -74,18 +74,19 @@ private long
getGuestOsIdFromHypervisorMapping(GuestOSHypervisorMapping mapping)
}
public void addGuestOsAndHypervisorMappings(long categoryId, String
displayName, List<GuestOSHypervisorMapping> mappings) {
- if (!addGuestOs(categoryId, displayName)) {
- LOG.warn("Couldn't add the guest OS with category id: " +
categoryId + " and display name: " + displayName);
- return;
- }
-
- if (CollectionUtils.isEmpty(mappings)) {
- return;
- }
-
long guestOsId = getGuestOsId(categoryId, displayName);
if (guestOsId == 0) {
LOG.debug("No guest OS found with category id: " + categoryId + "
and display name: " + displayName);
+ if (!addGuestOs(categoryId, displayName)) {
+ LOG.warn("Couldn't add the guest OS with category id: " +
categoryId + " and display name: " + displayName);
+ return;
+ }
+ guestOsId = getGuestOsId(categoryId, displayName);
+ } else {
+ // TODO: update is_user_defined to false
Review Comment:
How about adding a new guest OS entry if the existing one is user-defined ?
We are anyways deduplicating the list from listGuestOS command starting 4.19
version, we will show only the latest entry if there duplicates. cc
@DaanHoogland
--
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]