schema: Updating the cmd-sequence to task

The command sequence changed to task. This patch updates the relax-ng
scheme to reflect those changes.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
schema: Removing 'source' and changing 'defines'

The 'source' attribute will no longer be supported (it will be replaced
by XInclude).

This patch also changes the 'define' tags in the scheme from zeroOrMore
to optional, which results in better error reports.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
schema: Adding a schema for slavemachine xml

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
install: Adding schemes to the distribution

The schemes need to be installed with the controller so it can use them
during the runtime. This patch adds them to the setup.py script.

By default, they are stored in /usr/share/lnst/, but the path can be
configured in the controller config file using the 'resource_dir'
option.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
XmlParser: Moving the parser from DOM to etree

In this patch, the old and big DOM parser is removed and replaced by a
way more lighweight variant using the etree.

With the etree, LNST can use the RelaxNG schemes to verify the XML
syntax so almost all error checks were removed from the code.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
XmlProcessing: Updating the objects to support etree

The XmlProcessingError, XmlCollection, and XmlData objects were updated,
so they support the etree nodes instead of the DOM nodes that were
previously used.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
XmlProcessing: Removing the XmlDomTreeInit

Removing some old DOM-tree related code.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
XmlTemplates: Changing to support etree

The XML parser changed from DOM to etree. This patch changes the
XmlTemplates class to support etree. Some older code was also removed.

Alias and template functions processing is now handled separately.
Aliases are preprocessed before the document is parsed, while template
functions are expanded during the parsing.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
controller: Rewriting recipe parsing

The RecipeParse class was renamed to RecipeParser and completely
rewritten to use the lxml etree instead of the Document Object Model for
processing XML files.

The etree supports document validation using the RelaxNG schema. Using
this lead to significant simplification of the parsing code.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
controller: Rewriting slavemachine parsing

With the changes in recipe parser, the slave machine parser has been
changed to use etree as well. Again, due to validation using the schema,
the code is now much simpler.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>