[jboss-jira] [JBoss JIRA] (WFCORE-2670) list-add doesn't work for nested list of child attribute
Brian Stansberry (JIRA)
issues at jboss.org
Wed Apr 12 15:53:00 EDT 2017
[ https://issues.jboss.org/browse/WFCORE-2670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13393219#comment-13393219 ]
Brian Stansberry commented on WFCORE-2670:
------------------------------------------
First issue here is AbstractCollectionHandler is not propagating failure descriptions that are recorded by the read-attribute step it adds. Fixing that provides more info:
{code}
[standalone at embedded /] /subsystem=elytron/ldap-realm=foobar2:list-add(name=identity-mapping.new-identity-attributes,value={name=key2,value=["val1","val2"]})
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0393: Could not resolve attribute expression: 'identity-mapping.new-identity-attributes'",
"rolled-back" => true
}
{code}
The cause of that is this in EnhancedSyntaxSupport where it is trying to read the target resource's model:
{code}
if (result.has(part)) {
result = result.get(part);
} else {
throw ControllerLogger.MGMT_OP_LOGGER.couldNotResolveExpression(attributeExpression);
}
{code}
The 'result' node when it fails is the DMR for the 'identity-mapping' attribute. It does not have any child named 'new-identity-attributes' hence the failure. So the first question is why not. It's not super surprising as the add op didn't configure this attribute, so that's probably the answer. In which case the second question is how to deal with that. Perhaps simply being lenient is fine.
> list-add doesn't work for nested list of child attribute
> --------------------------------------------------------
>
> Key: WFCORE-2670
> URL: https://issues.jboss.org/browse/WFCORE-2670
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Reporter: Claudio Miranda
> Assignee: Brian Stansberry
> Priority: Critical
>
> The list-add doesn't work for a child of an attribute as in the example below
> Add a dir-context first
> {code}
> /profile=full/subsystem=elytron/dir-context=dir2:add(url="ldap://test")
> {code}
> Add a ldap-realm
> {code}
> /profile=full/subsystem=elytron/ldap-realm=foobar2:add(dir-context=dir2,identity-mapping={rdn-identifier=test})
> {
> "outcome" => "success",
> "result" => undefined,
> "server-groups" => {"main-server-group" => {"host" => {"master" => {"server-one" => {"response" => {
> "outcome" => "success",
> "response-headers" => {"process-state" => "reload-required"}
> }}}}}}
> }
> {code}
> This is the command to add the item to the list
> {code}
> /profile=full/subsystem=elytron/ldap-realm=foobar2:list-add(name=identity-mapping.new-identity-attributes,value={name=key2,value=["val1","val2"]})
> {
> "outcome" => "failed",
> "result" => undefined,
> "server-groups" => undefined,
> "rolled-back" => true
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list