Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLIParser not handling slahes (/) or colons (:) in values correctly OR not parsing quoted text correctly into XML #243

Open
cqwense opened this issue Jun 11, 2018 · 0 comments

Comments

@cqwense
Copy link
Contributor

cqwense commented Jun 11, 2018

Fair warning: I am using commits from these two PRs:

  1. Display parser.failure_reason when there's a failure. #242 ( increased CLIParser debug output )
  2. Allow $ in treetop parsed strings. #241 ( fixes @, $, and # for identifiers )

Sorry for what might be too much info, but I can't figure out if the module/parser are enforcing rules I simply don't understand, if the parser is overly aggressive -- OR if quoting to escape parser errors is not operating as expected.

case 1 , slashes ( / )

wildfly::cli { 'add DLQ queue':
command => '/subsystem=messaging/hornetq-server=default/jms-queue=DLQ:add(entries=[queue/DLQ])',
unless => '(outcome == success) of /subsystem=messaging/hornetq-server=default/jms-queue=DLQ:read-resource',
}

Error: Invalid command syntax. Could not parse: /subsystem=messaging/hornetq-server=default/jms-queue=DLQ:add(entries=[queue/DLQ])
Failure reason: Expected one of [a-zA-Z0-9_.-@$#], ', ', ']' at line 1, column 77 (byte 77) after (entries=[queue
Error: /Stage[main]/Profiles::Hdap_api/Wildfly::Cli[add DLQ queue]/Wildfly_cli[add DLQ queue]/executed: change from false to true failed: Invalid command syntax. Could not parse: /subsystem=messaging/hornetq-server=default/jms-queue=DLQ:add(entries=[queue/DLQ])


case 2, colons (:)

wildfly::cli { 'add connection-factory':
command => '/subsystem=messaging/hornetq-server=default/connection-factory=InVmConnectionFactory:add(connector={in-vm=>undefined}, entries=[java:jboss/ConnectionFactory])',
unless => '(outcome == success) of /subsystem=messaging/hornetq-server=default/connection-factory=InVmConnectionFactory:read-resource',
}

Error: Invalid command syntax. Could not parse: /subsystem=messaging/hornetq-server=default/connection-factory=InVmConnectionFactory:add(connector={in-vm=>undefined}, entries=[java:jboss/ConnectionFactory])
Failure reason: Expected one of [a-zA-Z0-9_.-@$#], ', ', ']' at line 1, column 133 (byte 133) after (connector={in-vm=>undefined}, entries=[java


case 3, quoting everything

in both cases I can get passed the CLIParser error by putting the values in quotes:

...
"java:jboss/ConnectionFactory"
"queue/DLQ"
...

edit: markdown won't seem to properly escape this ( yay irony ) , but what ends up in the XML is

'&' + 'quot;'

anywhere a double quote was in the wildfly::cli command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant