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

When generating CIB syntax, elide initial in some cases #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krig
Copy link
Contributor

@krig krig commented May 18, 2015

This is something I worked on this weekend, but now that I have it working, I don't know if I really think it is a good idea. This would make eliding the "params" or "attributes" the default even when displaying the configuration, except when there are multiple params or attributes tags.

Dejan, how do you feel about this? I'm apprehensive, because although I think it improves the readability of examples like

primitive vip IPaddr2 ip=192.168.0.200

...there are other cases that aren't as clear cut, and it makes the generated syntax context-sensitive, not just the accepted input (where I don't think there are any downsides to allowing it).

So right now I am inclined to throw this away :P

@dmuhamedagic
Copy link
Collaborator

dmuhamedagic commented May 18, 2015 via email

@krig
Copy link
Contributor Author

krig commented May 18, 2015

In the case of meta attributes listed before params, it will generate the old/current style output. So that case should work fine. It is only if the first element is a params list, AND if there is only one params list, that it skips the params keyword.

@krig
Copy link
Contributor Author

krig commented May 18, 2015

BTW, I have also been thinking about handling the "meta target-role=started|stopped" case in a special way, and replace it with for example the special keywords "::start" | "::stop". Not sure about this either :) (the :: is one suggestion, other suggestions are =>start, =>stop

So

primitive p0 Dummy state=1 =>start

instead of

primitive p0 Dummy params state=1 meta target-role=Started

Another idea I have is to rename "primitive" to "resource". primitive seems like a terrible XML-ism that has crept into the CIB syntax ;) But I don't know if this is something worth changing. The resource concept also includes groups and clones, but I think calling primitives resources makes sense.

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

Successfully merging this pull request may close these issues.

2 participants