Bug 1442056 - Missing validation of option parameters for fence agents when using REST API
Summary: Missing validation of option parameters for fence agents when using REST API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Infra
Version: 4.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: Eli Mesika
QA Contact: Petr Matyáš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-13 12:18 UTC by Petr Matyáš
Modified: 2017-12-20 11:17 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-20 11:17:10 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+
lsvaty: testing_ack+


Attachments (Terms of Use)
engine log (280.45 KB, text/plain)
2017-04-13 12:18 UTC, Petr Matyáš
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 78826 0 master MERGED core: Adding validation of PM agent port in BLL 2017-07-11 10:18:57 UTC

Description Petr Matyáš 2017-04-13 12:18:21 UTC
Created attachment 1271421 [details]
engine log

Description of problem:
There is no validation of option parameters of fence agents through RESTApi, though there is a validation for these options when you edit them in UI.

Eg. You can't add a fence agent with option port=rhv01 through UI (bz 1375646), but when you do the same with RESTApi, you have new fence agent with invalid parameter, which shows only in RESTApi and not in UI.

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

How reproducible:
always

Steps to Reproduce:
1. CREATE request content is --  url:/ovirt-engine/api/hosts/$HOST_ID/fenceagents body:<agent>
    <address>$ADDRESS</address>
    <concurrent>false</concurrent>
    <options>
        <option>
            <name>port</name>
            <value>rhv01</value>
        </option>
    </options>
    <order>1</order>
    <password>$PASSWORD</password>
    <type>ipmilan</type>
    <username>$USERNAME</username>
</agent>

Actual results:
GET request content is --  url:/ovirt-engine/api/hosts/$HOST_ID/fenceagents 
<agents>
    <agent href="/ovirt-engine/api/hosts/$HOST_ID/fenceagents/$AGENT_ID" id="$AGENT_ID">
        <address>$ADDRESS</address>
        <encrypt_options>false</encrypt_options>
        <options>
            <option>
                <name>port</name>
                <value>rhv01</value>
            </option>
        </options>
        <order>1</order>
        <password>$PASSWORD</password>
        <type>ipmilan</type>
        <username>$USERNAME</username>
        <host href="/ovirt-engine/api/hosts/$HOST_ID" id="$HOST_ID"/>
    </agent>
</agents>

Expected results:
adding should not succeed

Additional info:

Comment 1 Juan Hernández 2017-04-17 07:24:53 UTC
The API doesn't perform this kind of validations, therefore moving to the backend component.

Comment 2 Petr Matyáš 2017-07-17 11:28:10 UTC
Verified on ovirt-engine-4.2.0-0.0.master.20170716234133.git58bf684.el7.centos.noarch

Comment 3 Sandro Bonazzola 2017-12-20 11:17:10 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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