Bug 1335669 - Automate | Assertion with failed substitution should raise error
Summary: Automate | Assertion with failed substitution should raise error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.6.1
Assignee: mkanoor
QA Contact: Milan Falešník
URL:
Whiteboard: automate
Depends On:
Blocks: 1357013
TreeView+ depends on / blocked
 
Reported: 2016-05-12 19:56 UTC by Tina Fitzgerald
Modified: 2022-07-09 07:43 UTC (History)
8 users (show)

Fixed In Version: 5.6.1.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1357013 (view as bug list)
Environment:
Last Closed: 2016-08-18 17:44:57 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1634 0 normal SHIPPED_LIVE Important: CFME 5.6.1 security, bug fix, and enhancement update 2016-08-18 21:43:52 UTC

Description Tina Fitzgerald 2016-05-12 19:56:45 UTC
Description of problem:
Resolving an instance with an assertion containing an invalid value continues resolution when it should raise an error.

How reproducible:
Create a writable domain.
Copy a class to the writable domain.
Add an assertion to the class schema.
Create an instance, giving the assertion an invalid substitution like ${/#this_value_does_not_exist} 
Use simulate to call instance. (Use /system/request/call_instance) and provide namespace, class, instance in the attribute value pairs.

Actual results:
The instance continues as if there was no assertion

Expected results:
An error should be raised.

Comment 2 mkanoor 2016-07-11 22:33:27 UTC
Created PR https://github.com/ManageIQ/manageiq/pull/9737

Comment 3 CFME Bot 2016-07-12 00:01:43 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/56f561367418b7999cf109056730123c6c383bef

commit 56f561367418b7999cf109056730123c6c383bef
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Mon Jul 11 18:25:16 2016 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Mon Jul 11 18:25:16 2016 -0400

    Raise exception in assertion processing
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1335669
    
    If an attribute is not found during assertion processing
    raise an exception instead of continuing silently

 lib/miq_automation_engine/engine/miq_ae_object.rb  | 17 +++---
 lib/miq_automation_engine/miq_ae_exception.rb      |  1 +
 .../miq_automation_engine/miq_ae_assertion_spec.rb | 60 ++++++++++++++++++++++
 3 files changed, 72 insertions(+), 6 deletions(-)
 create mode 100644 spec/lib/miq_automation_engine/miq_ae_assertion_spec.rb

Comment 5 Milan Falešník 2016-08-01 12:05:30 UTC
Verified in 5.6.1.0

Automation Error: Attribute xyz not found for object []


When putting ${#xyz} in the assertion.

Comment 7 errata-xmlrpc 2016-08-18 17:44:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://rhn.redhat.com/errata/RHSA-2016-1634.html


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