Skip to content

Commit

Permalink
[HHQ-3235] Add <ResourceInfo> block for service autoIdentifier. Allow…
Browse files Browse the repository at this point in the history
… updates of this field via sync.
  • Loading branch information
Ryan Morgan committed Jul 9, 2009
1 parent 26e14b4 commit ceee69b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion hqu/hqapi1/app/ResourceController.groovy
Expand Up @@ -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)
}
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ceee69b

Please sign in to comment.