[ClusterLabs] best practice for scripting
tbskyd at gmail.com
Tue Apr 13 19:47:14 EDT 2021
Ken Gaillot <kgaillot at redhat.com>
> FYI, the old and new status XML are nearly identical. The old XML's
> outermost element is
> <crm_mon version="...">
> while the new XML has
> <pacemaker-result api-version="..." request="...">
> <status code="0" message="OK"/>
> As long as you're not looking at those particular elements, parsing the
> XML output is the same.
> The format is actually stable and selectable since Pacemaker 2.0.3:
> crm_mon --as-xml gets the old format, crm_mon --output-as=xml gets the
> new. pcs status xml has continued to use --as-xml, but will switch to
> --output-as=xml, thus Tomas's warning.
Thanks a lot!
the explanation is so clear that I have no excuse to rewrite my scripts.
I already use 'crm_mon' in my scripts, but many times parse 'pcs'
result is simpler so I just use it.
now I understand what to do.
More information about the Users