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:
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
requesting dev to attach CLI script or snippet to support the repro steps ...