Bug 858030 - Provider HWP with 0 storage should be valid
Summary: Provider HWP with 0 storage should be valid
Keywords:
Status: CLOSED EOL
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: aeolus-conductor
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
Assignee: Angus Thomas
QA Contact: Rehana
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-17 20:07 UTC by Matt Wagner
Modified: 2020-03-27 18:38 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-27 18:38:49 UTC
Embargoed:


Attachments (Terms of Use)

Description Matt Wagner 2012-09-17 20:07:21 UTC
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 13:23:46 UTC
Pull request sent: https://github.com/aeolusproject/conductor/pull/64

Comment 3 Matt Wagner 2012-10-02 16:56:02 UTC
On 1.1, cherry-picked from master:

commit 21a4725d997a724f3bea0fff1eec75933b54c775
Author: Matt Wagner <matt.wagner>
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.