Bug 1059932 - PC classes must use data directory configured in PC, not just use "data"
Summary: PC classes must use data directory configured in PC, not just use "data"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugin Container
Version: 4.10
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: RHQ 4.10
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-31 01:03 UTC by John Mazzitelli
Modified: 2014-04-23 12:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-23 12:31:15 UTC
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2014-01-31 01:03:41 UTC
Plugin container is writing data in wrong directory.

These are files getting written to ${current working directory}/data, but if the PC was told to use a different data directory, that configuration is ignored. This is what I see:

data/
    |_rc/
        |_10/
            |_10125
            |_10122
            |_10111

This was a result of the agent perf stuff. We can't just say "data" with a relative path in the PC - the data directory is configurable. You have to get the data directory as configured in the plugin container. Somehow, this code in ConfigurationCheckExecutor (see below) has to get PluginContainerConfiguration.getDataDirectory() - the InventoryManager has this plugin configuration (as do all the PC managers), so somehow they need to get that data dir into here:

---------

    public static boolean persistConfigurationToFile(int resourceId, Configuration liveConfiguration, Log log) {
        boolean success = true;
        try {
            String pathname = "data/rc/" + String.valueOf(resourceId/1000); // Don't put too many files into one data dir
            File dataDir = new File(pathname);
...

    static private Configuration loadConfigurationFromFile(int resourceId) {
        String pathname = "data/rc/" + String.valueOf(resourceId/1000); // Don't put too many files into one data dir
        File dataDir = new File(pathname);
...

Comment 1 Jay Shaughnessy 2014-02-03 17:32:58 UTC
master commit ea1f3b883340dd4db2724f01e80484a497c4f048
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Feb 3 12:29:48 2014 -0500

    Change things around to us the proper data directory, as configured for the
    plugin container (via InventoryManager)




Test Notes:
Nothing to test here, as long as unit tests are passing and people no longer complain about the data directories showing up then all is good.

Comment 2 Heiko W. Rupp 2014-04-23 12:31:15 UTC
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.


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