You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/03/22 14:52:20 UTC

[GitHub] [cloudstack] deargopinath opened a new pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'

deargopinath opened a new pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'
URL: https://github.com/apache/cloudstack/pull/3982
 
 
   ## Description
   I provided a fix for the error reported in issue # 3642
   Details of the error can be found at: 
       https://github.com/apache/cloudstack/issues/3642
   
   **Root cause of the problem:**
   The incorrect error messages were found in the lines 431, 434 and 437 of the file - 
       server/src/main/java/org/apache/cloudstack/vm/VmImportManagerImpl.java
   
   _**Line # 431:**_
           ` throw new ServerApiException ... CPU cores does not matches ... `
   
   _**Line # 434:**_
           ` throw new ServerApiException ... memory does not matches ...`
   
   _**Line # 437:**_
            `throw new ServerApiException ... CPU speed does not matches ...`
   
   **Changes done to fix the problem:**
   
   I replaced the word 'matches' with 'match' inside the 3 error messages.
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   I compiled the code after the changes and tested whether the error messages with the updated text are shown for these 3 scenarios of Server API exceptions:
   1. CPU cores not matching
   2. Memory not matching
   3. CPU speed not matching
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'
URL: https://github.com/apache/cloudstack/pull/3982#discussion_r397756101
 
 

 ##########
 File path: server/src/main/java/org/apache/cloudstack/vm/VmImportManagerImpl.java
 ##########
 @@ -428,13 +428,13 @@ private ServiceOfferingVO getUnmanagedInstanceServiceOffering(final UnmanagedIns
             serviceOffering = serviceOfferingDao.getComputeOffering(serviceOffering, parameters);
         } else {
             if (!cpu.equals(serviceOffering.getCpu()) && !instance.getPowerState().equals(UnmanagedInstanceTO.PowerState.PowerOff)) {
-                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Service offering (%s) %d CPU cores does not matches VM CPU cores %d  and VM is not in powered off state (Power state: %s)", serviceOffering.getUuid(), serviceOffering.getCpu(), cpu, instance.getPowerState()));
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Service offering (%s) %d CPU cores does not match VM CPU cores %d  and VM is not in powered off state (Power state: %s)", serviceOffering.getUuid(), serviceOffering.getCpu(), cpu, instance.getPowerState()));
 
 Review comment:
   Can you please remove the extra blank space at `CPU cores %d  and VM`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] deargopinath commented on a change in pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'

Posted by GitBox <gi...@apache.org>.
deargopinath commented on a change in pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'
URL: https://github.com/apache/cloudstack/pull/3982#discussion_r398002330
 
 

 ##########
 File path: server/src/main/java/org/apache/cloudstack/vm/VmImportManagerImpl.java
 ##########
 @@ -428,13 +428,13 @@ private ServiceOfferingVO getUnmanagedInstanceServiceOffering(final UnmanagedIns
             serviceOffering = serviceOfferingDao.getComputeOffering(serviceOffering, parameters);
         } else {
             if (!cpu.equals(serviceOffering.getCpu()) && !instance.getPowerState().equals(UnmanagedInstanceTO.PowerState.PowerOff)) {
-                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Service offering (%s) %d CPU cores does not matches VM CPU cores %d  and VM is not in powered off state (Power state: %s)", serviceOffering.getUuid(), serviceOffering.getCpu(), cpu, instance.getPowerState()));
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Service offering (%s) %d CPU cores does not match VM CPU cores %d  and VM is not in powered off state (Power state: %s)", serviceOffering.getUuid(), serviceOffering.getCpu(), cpu, instance.getPowerState()));
 
 Review comment:
   Hi Gabriel,  Thank you very much for the review. I made the 2 changes as per the review. I will submit the pull request shortly.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #3982: Updated 3 error messages to replace the word 'matches' with 'match'
URL: https://github.com/apache/cloudstack/pull/3982#discussion_r397756642
 
 

 ##########
 File path: server/src/main/java/org/apache/cloudstack/vm/VmImportManagerImpl.java
 ##########
 @@ -428,13 +428,13 @@ private ServiceOfferingVO getUnmanagedInstanceServiceOffering(final UnmanagedIns
             serviceOffering = serviceOfferingDao.getComputeOffering(serviceOffering, parameters);
         } else {
             if (!cpu.equals(serviceOffering.getCpu()) && !instance.getPowerState().equals(UnmanagedInstanceTO.PowerState.PowerOff)) {
-                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Service offering (%s) %d CPU cores does not matches VM CPU cores %d  and VM is not in powered off state (Power state: %s)", serviceOffering.getUuid(), serviceOffering.getCpu(), cpu, instance.getPowerState()));
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Service offering (%s) %d CPU cores does not match VM CPU cores %d  and VM is not in powered off state (Power state: %s)", serviceOffering.getUuid(), serviceOffering.getCpu(), cpu, instance.getPowerState()));
 
 Review comment:
   Additionally, considering the fact that **CPU cores** is plural (of a _CPU core_) it should be "CPU core**s do** not **match**"

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services