Bug 1046611 - [oVirt][infra] Device custom properties syntax check is wrong
Summary: [oVirt][infra] Device custom properties syntax check is wrong
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.4.0
Assignee: Martin Perina
QA Contact: movciari
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-26 10:16 UTC by Mike Kolesnik
Modified: 2014-03-31 12:28 UTC (History)
6 users (show)

Fixed In Version: ovirt-3.4.0-beta1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-31 12:28:12 UTC
oVirt Team: ---


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 23062 0 None None None Never

Description Mike Kolesnik 2013-12-26 10:16:33 UTC
Description of problem:
Trying to set an empty custom property results in an error on the engine: 
2013-12-26 09:55:46,700 WARN  [org.ovirt.engine.core.bll.network.vm.UpdateVnicProfileCommand] (http-/0.0.0.0:8080-1) [246beb72] CanDoAction of action UpdateVnicProfile failed. Reasons:VAR__TYPE__VNIC_PROFILE,VAR__ACTION__UPDATE,ACTION_TYPE_FAILED_INVALID_CUSTOM_PROPERTIES_INVALID_SYNTAX



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


How reproducible:
Always


Steps to Reproduce:
1. Create a custom property allowing an empty value, such as:
engine-config -s CustomDeviceProperties="{type=interface;prop={someProp=([a-z0-9A-Z]*)$}}" --cver=3.3
2. Add a network on a 3.3 data center.
3. Add a network profile and on the dialog select your "someProp" property but don't enter any value.
4. Click OK to add the profile.

Actual results:
You will get an error "Error while executing action: Cannot edit VM network interface profile if custom properties are in invalid format. Please check the input."


Expected results:
The profile should be saved without error.


Additional info:
The error comes from a check in org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils.validateProperties(Version, VmDeviceGeneralType, Map<String, String>)

This method invokes syntaxErrorInProperties(properties) which is meant for checking the property definition in the configuration, not the actual uasge of the properties and their conformity to the syntax (this check is done later in the validateProperties method).

This should probably be fixed also for other usages of custom properties.

Comment 1 Martin Perina 2014-01-06 05:42:41 UTC
Device custom properties syntax is inherited from VM properties syntax, which requires that defined property always has non-empty value. So do we want to allow properties with empty value? If so, should it be allowed for both device and VM properties?

Comment 2 Yair Zaslavsky 2014-01-06 09:54:24 UTC
Martin the set of possible values is defined by the regex. If the regex matches an empty string (empty value) we should allow storing empty value.

Comment 3 Sandro Bonazzola 2014-03-31 12:28:12 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released


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