Bug 1028393

Summary: Error message shows twice when trying to set the additional storage lower than the consumed disk quota
Product: OpenShift Online Reporter: Meng Bo <bmeng>
Component: MasterAssignee: Lili Nader <lnader>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: mfisher
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:29:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Meng Bo 2013-11-08 10:59:18 UTC
Description of problem:
Add storage to the cartridge and fill up the disk quota, then try to reduce the storage for the gear, the error message about quota exceeded will show twice.

    <message>
      <severity>error</severity>
      <text>Current usage 1332216 exceeds requested quota 1048576Current usage 1332216 exceeds requested quota 1048576</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>


Version-Release number of selected component (if applicable):
devenv_4006

How reproducible:
always

Steps to Reproduce:
1. Create app 
2. Add storage to the cartridge
3. Fill the disk over 1GB base storage
4. Remove the storage to the cartridge

Actual results:
# curl -k -H 'Accept: application/xml' --user bmeng:xxx https://localhost/broker/rest/domains/bmengdev1/applications/php1/cartridges/php-5.3 -XPUT -d additional_gear_storage=0

      <text>Current usage 1332216 exceeds requested quota 1048576Current usage 1332216 exceeds requested quota 1048576</text>
   
Expected results:
Should show the error message only once.

Additional info:

Comment 3 Meng Bo 2013-11-14 06:15:23 UTC
Checked on devenv_4031 with both CLI and rest api, issue fixed.

  <messages>
    <message>
      <severity>error</severity>
      <text>Current usage 1537092 exceeds requested quota 1048576</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>


[root@dhcp-10-180 php1]# rhc cartridge-storage php -a php1 --set 0
Using php-5.3 (PHP 5.3) for 'php'
Set storage on cartridge ... Current usage 1537092 exceeds requested quota 1048576


Move bug to verified.