summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/enterprise/binding/src/main/java/org/rhq/bindings/client/ResourceClientProxy.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/ResourceClientProxy.java b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/ResourceClientProxy.java
index 10ee612..0199c77 100644
--- a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/ResourceClientProxy.java
+++ b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/ResourceClientProxy.java
@@ -491,10 +491,13 @@ public class ResourceClientProxy {
public Configuration getResourceConfiguration() {
if (!LazyLoadScenario.isShouldLoad())
return null;
-
- return remoteClient.getProxy(ConfigurationManagerRemote.class).getResourceConfiguration(
- remoteClient.getSubject(),
- resourceClientProxy.resourceId);
+
+ //make sure to fetch the latest known resource config. This ensures that
+ //the server goes out to the agent if there is no known config yet and thus
+ //giving the scripting user an always up-to-date info.
+ ResourceConfigurationUpdate update = remoteClient.getProxy(ConfigurationManagerRemote.class).getLatestResourceConfigurationUpdate(
+ remoteClient.getSubject(), resourceClientProxy.resourceId);
+ return update == null ? null : update.getConfiguration();
}
public ConfigurationDefinition getResourceConfigurationDefinition() {