Bug 768099 - Drift definitions can be created for resources that do not support drift using remote APIs
Summary: Drift definitions can be created for resources that do not support drift usin...
Keywords:
Status: ASSIGNED
Alias: None
Product: RHQ Project
Classification: Other
Component: drift
Version: 4.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: jon30-sprint10, rhq43-sprint10
TreeView+ depends on / blocked
 
Reported: 2011-12-15 18:38 UTC by John Sanda
Modified: 2022-03-31 04:28 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description John Sanda 2011-12-15 18:38:12 UTC
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 14:23:44 UTC
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 15:31:03 UTC
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.