From ceee69bff724c4852b435a81965db5e9c164579c Mon Sep 17 00:00:00 2001 From: Ryan Morgan Date: Thu, 9 Jul 2009 15:27:23 -0700 Subject: [PATCH] [HHQ-3235] Add block for service autoIdentifier. Allow updates of this field via sync. --- hqu/hqapi1/app/ResourceController.groovy | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hqu/hqapi1/app/ResourceController.groovy b/hqu/hqapi1/app/ResourceController.groovy index 29c0c7b5..10b6b658 100644 --- a/hqu/hqapi1/app/ResourceController.groovy +++ b/hqu/hqapi1/app/ResourceController.groovy @@ -57,7 +57,8 @@ class ResourceController extends ApiController { ResourceInfo(key: PROP_INSTALLPATH, value: s.installPath) ResourceInfo(key: PROP_AIIDENIFIER, value: s.autoinventoryIdentifier) } else if (r.isService()) { - // Nothing yet. + def s = r.toService() + ResourceInfo(key: PROP_AIIDENIFIER, value: s.autoinventoryIdentifier) } } } @@ -620,6 +621,13 @@ class ResourceController extends ApiController { if (installpath) { config.put(PROP_INSTALLPATH, installpath.'@value') } + } else if (prototype.isServicePrototype()) { + def aiid = xmlResource['ResourceInfo'].find { + it.'@key' == PROP_AIIDENIFIER + } + if (aiid) { + config.put(PROP_AIIDENIFIER, aiid.'@value') + } } // Update @@ -696,6 +704,12 @@ class ResourceController extends ApiController { } else if (prototype.isServicePrototype()) { try { + def aiid = xmlResource['ResourceInfo'].find { + it.'@key' == PROP_AIIDENIFIER + } + if (aiid) { + config.put(PROP_AIIDENIFIER, aiid.'@value') + } resource = prototype.createInstance(parent, name, user, config) } catch (IllegalArgumentException e) {