Bug 827633 - Unable to enter a Drift Detection Definition Base Directory fileSystem path that contains parenthesis
Summary: Unable to enter a Drift Detection Definition Base Directory fileSystem path t...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Drift, UI
Version: JON 3.1.0
Hardware: All
OS: All
urgent
high
Target Milestone: ---
: JON 3.1.1
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 827634
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-01 22:25 UTC by Larry O'Leary
Modified: 2018-11-27 19:26 UTC (History)
2 users (show)

Fixed In Version:
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 11:02:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 133903 0 None None None 2012-06-01 22:43:08 UTC

Description Larry O'Leary 2012-06-01 22:25:40 UTC
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 18:34:41 UTC
Fixed in upstream, waiting for branch to cherry-pick.

Comment 2 Jay Shaughnessy 2012-07-17 18:57:21 UTC
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 19:25:14 UTC
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 19:26:55 UTC
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 18:51:59 UTC
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 10:54:50 UTC
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.