Bug 827633 - Unable to enter a Drift Detection Definition Base Directory fileSystem path that contains parenthesis
Unable to enter a Drift Detection Definition Base Directory fileSystem path t...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Drift, UI (Show other bugs)
JON 3.1.0
All All
urgent Severity high
: ---
: JON 3.1.1
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On: 827634
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-01 18:25 EDT by Larry O'Leary
Modified: 2013-09-11 07:02 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 827634 (view as bug list)
Environment:
JON 3.0.1 and JON 3.1.0.Beta1 Tested in Linux
Last Closed: 2013-09-11 07:02:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 133903 None None None 2012-06-01 18:43:08 EDT

  None (edit)
Description Larry O'Leary 2012-06-01 18:25:40 EDT
Description of problem:
When attempting to set up a drift definition for monitoring an application on Windows, the UI does not allow the user to enter a path which contains a parenthesis.

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

How reproducible:
Always

Steps to Reproduce:
1.  Install JON system
2.  Create a test directory that contains a parenthesis

        cd ${TESTENV_DIR}
        mkdir -p "Program Files (x86)"/test/for/drift

3.  Add some files to the test directory

        cd ${TESTENV_DIR}
        touch "Program Files (x86)"/test/for/drift/file01.txt
        touch "Program Files (x86)"/test/for/drift/file02.txt
        echo "A file with only one line of text" >>"Program Files (x86)"/test/for/drift/file02.txt

4.  Start JON system
5.  Import platform into inventory
6.  Create a **Resource Drift Detection Definition** for the newly imported platform resource

    1.  Navigate to the platform resource's *Drift > Definitions* tab
    2.  Click the **New** button
    3.  Select **Drift Definition Template** `Template-File System`
    4.  Click **Next**
    5.  Set the following values:

        *   **Drift Definition Name:** `Path with parenthesis`
        *   **Drift Definition Description:** `Monitor a file system path that contains parenthesis () in its name for drift.`
        *   **Enabled:** `Yes`
        *   **Attached to Template:** `Yes`
        *   **Drift Handling Mode:** `normal``
        *   **Pinned:** `No`
        *   **Interval:** `90`
        *   **Base Directory:**
            *   **Value Context:** `fileSystem`
            *   **Value Name:** <THE FULL PATH CREATED EARLIER WHICH CONTAINS ( and/or )>
        *   **Includes:** **Leave empty**
        *   **Excludes:** **Leave empty**
        
        Please note that this fails due to the bug. The **Base Directory/Value Name** value will show as invalid due to the `(` and/or `)`


        To workaround this bug:

        *   **Base Directory:**
            *   **Value Context:** `fileSystem`
            *   **Value Name:** <THE ROOT PATH UP TO THE DIRECTORY THAT CONTAINS THE ( and/or )>
        *   **Includes:**
            *   **Path:** `.`
            *   **Pattern:** `Program Files ?x86?/test/for/drift/**`
        *   **Excludes:** **Leave empty**

    6.  Click **Finish**
  
Actual results:
Unable to complete step 6.6. because **Base Directory > Value Name** reports "Invalid Value"

Expected results:
The Drift Detection Definition should have been saved and a snapshot properly created.

Additional info:
This affects other valid file system characters as well. Parenthesis is a pretty bad offender though because Windows systems use (x86) in file paths to denote 32-bit versions of applications and libraries:

 C:\Program Files (x86)\...
 C:\Windows\System (x86)\...
 C:\Windows (x86)\...
Comment 1 Jay Shaughnessy 2012-06-07 14:34:41 EDT
Fixed in upstream, waiting for branch to cherry-pick.
Comment 2 Jay Shaughnessy 2012-07-17 14:57:21 EDT
Release/jon3.1.x commit: 081742ba378fd3d8d0e9e3942faed49210fedd9d

    - Add support for Windows allowance of parentheses in directory names.
    - Add support for more flexible specification of the drift base directory
    in a Drift Filter.
    - Add relevant tests for new features.
    
    Cherry-pick of master db072ef663ee9d9e276971e1cce9021e26cafef5
Comment 3 Jay Shaughnessy 2012-07-17 15:25:14 EDT
A second commit for this one as well:

Release/jon3.1.x commit: b0e59ada3a18169b3a1a6802ec4c9516364090f9

    There were two ways to go here. One was to add special case handling for
    the various filter paths that equate to ".".  The other was to normalize
    in the Filter constructor.  Since I tried option 1 and missed a spot in my
    first try to fix it, I've now opted for option 2.  The downside is only that
    what the user types may get normalized to ".". But I added some more description
    text to state as much. Also, existing Filter paths using "/" or "./" will
    need to be updated to "." manually, but I doubt there are any out there
    currently since it wasn't working.
    
    Conflicts:
    
    	modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftDetector.java
    	modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/FilterFileVisitorTest.java
    
    Cherry-pick of master commit: 00ea14c228bd08d6572d0f17ef8040e447b9a0dd
Comment 4 Jay Shaughnessy 2012-07-17 15:26:55 EDT
Note, these cherry picked commits also fix bug 827647 - Relative path for Drift Detections Definition Include/Excludes Path does not handle relative path alias or trailing file separator correctly.

The work was done together so even though 827647 was not triaged for 3.1.1 it was easier to take the fixes for both.
Comment 5 John Sanda 2012-08-02 14:51:59 EDT
JON 3.1.1 ER1 build is available. Moving to ON_QA.

https://brewweb.devel.redhat.com/buildinfo?buildID=226942
Comment 6 Sunil Kondkar 2012-08-28 06:54:50 EDT
Verified on Version: 3.1.1.ER3 (Build Number: 37108ca:67c6de8)

Verified by following the steps. The Drift Detection Definition with Base Directory filesystem path containing a parenthesis is saved and a snapshot is created.

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