Bug 858030 - Provider HWP with 0 storage should be valid
Provider HWP with 0 storage should be valid
Status: MODIFIED
Product: CloudForms Cloud Engine
Classification: Red Hat
Component: aeolus-conductor (Show other bugs)
1.1.0
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Angus Thomas
Rehana
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-17 16:07 EDT by Matt Wagner
Modified: 2014-08-17 18:27 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Wagner 2012-09-17 16:07:21 EDT
Description of problem:
Conductor considers a provider hardware profile with 0GB of storage be invalid, and will refuse to save a HWP in that case. Since this is tied to adding a provider account, the whole transaction will fail.

There's no reason that zero should be invalid for storage. The validation should be changed to just require that it be non-negative (i.e., >= 0, not just >0.)

A little outside the scope of this task, but perhaps importing provider HWPs should be moved into a background task after the Provider Account is added.


Version-Release number of selected component (if applicable):
Upstream master, but probably all releases


Steps to Reproduce:
1. Outside Conductor, set up a cloud provider with a 0GB hardware profile. (OpenStack seems to do this out of the box.) I have a box on the internal network that does this if need be.
2. Add that as a provider.
3. Attempt to save a provider account for it.

Actual results:
Save fails, with:
Cannot add the Provider Account.
Errors

    1 error prohibited this Provider Account from being saved
    Failed to populate hardware_profiles: Validation failed: Storage is invalid



Expected results:
Save should succeed because 0GB is valid.


Additional info:
I cannot find a previous BZ for this, but have a strong feeling of deja vu here.
Comment 2 Matt Wagner 2012-09-18 09:23:46 EDT
Pull request sent: https://github.com/aeolusproject/conductor/pull/64
Comment 3 Matt Wagner 2012-10-02 12:56:02 EDT
On 1.1, cherry-picked from master:

commit 21a4725d997a724f3bea0fff1eec75933b54c775
Author: Matt Wagner <matt.wagner@redhat.com>
Date:   Mon Sep 17 17:40:54 2012 -0400

    BZ 858030 - Allow 0 storage in HWPs
    
    A hardware profile with no storage is a valid configuration,
    so Conductor should accept it.
    
    Resolves https://bugzilla.redhat.com/show_bug.cgi?id=858030
    (cherry picked from commit f684804bd558e658fa1543c85ff6be0a572a442e)

Note You need to log in before you can comment on or make changes to this bug.