Bug 768099 - Drift definitions can be created for resources that do not support drift using remote APIs
Drift definitions can be created for resources that do not support drift usin...
Status: ASSIGNED
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
4.2
Unspecified Unspecified
unspecified Severity medium (vote)
: ---
: ---
Assigned To: John Sanda
Mike Foley
:
Depends On:
Blocks: jon30-sprint10/rhq43-sprint10
  Show dependency treegraph
 
Reported: 2011-12-15 13:38 EST by John Sanda
Modified: 2011-12-19 11:39 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
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 John Sanda 2011-12-15 13:38:12 EST
Description of problem:
Using the remote APIs, you can create drift definitions for resources of types that do not support drift. This does not result in an errors of which I am aware. The problem is that there is no drift UI for types that do not support drift. A user could script creating definitions for resources that don't support drift, get no errors, and then have no way to view drift data in the UI.

Since we do not support creating definitions in the UI for types that do not support drift, then we need to be consistent with that behavior in the remote APIs


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


How reproducible:
always

Steps to Reproduce:
1. Log into the CLI
2. Create a drift definition for a resource that does not support drift (like an agent)
3. 
  
Actual results:
The definition is created without error. You can verify in two ways. 1) Look in the database in the rhq_drift_definition table. 2) Look in your agent installation and you should find the following file <AGENT_HOME>/data/changesets/<resource_id>/<drift_definition_name>/changeset.txt.

Expected results:
The definition should not get created and an exception should get thrown.

Additional info:
Comment 1 John Sanda 2011-12-19 09:23:44 EST
A few validation checks have been added.

1. make sure that the resource in fact supports drift management

2. if the definition has a template attached, make sure that the template exists in the database

3. if the definition has a template attached, make sure the template is from the same resource type as the type of the resource for which the definition is being created.

master commit hash: 615c99b2a0d856b316b558a4e6fd7989b4004a15
Comment 2 Mike Foley 2011-12-19 10:31:03 EST
requesting dev to attach CLI script or snippet to support the repro steps ...

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