summaryrefslogtreecommitdiff
path: root/virtinst/xmlapi.py
Commit message (Collapse)AuthorAgeFilesLines
* cli: Add --xml xpath option for virt-install and virt-xmlCole Robinson2020-09-111-1/+7
| | | | | | | | | | | | | | | | | | | The --xml option allows users to request raw XML edits to virt-install or virt-xml generated XML. This gives users a bit of a workaround incase we don't have proper support for some XML property. The --xml option can gain more features in the future if it makes sense, like setting XML namespaces for example. Basic usage is like: virt-install --xml ./@foo=bar ... Which will change the generated <domain> XML to have <domain foo='bar' ... virt-xml works similarly. It can only be combined with --edit currently. This only works with xpaths rooted against the entire document. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* xmlutil: Centralize all 'programming error' exceptionsCole Robinson2020-07-171-2/+3
| | | | | | | Raise them directly instead of adding the hard to read conditional into the function Signed-off-by: Cole Robinson <crobinso@redhat.com>
* po: Fix message format warnings printed from xgettextCole Robinson2020-07-111-2/+3
| | | | Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Fix codespell errorsCole Robinson2019-07-121-1/+1
|
* xmleditor: Add the shared codeCole Robinson2019-06-131-0/+7
| | | | | | | | | The XML editor ui is a two tabbed notebook, one 'Details' tab and one 'XML' tab. The latter has a gtksourceview and allows editing the raw libvirt XML for whatever the selected object is. API users will programmatically insert the xmleditor notebook into their UI, with the existing UI under the details tab.
* virtinst: Add full test coverage for xml*.py filesCole Robinson2019-06-091-5/+4
|
* virtinst: Rename util to xmlutilCole Robinson2019-06-071-4/+4
| | | | | The only functions left in there are largely for xml handling, so make it explicit
* xmlbuilder: Add replace_childCole Robinson2019-06-051-0/+13
| | | | This will be used for UI XML editing of devices
* devices: char: Add CharSourceCole Robinson2019-05-141-1/+7
| | | | | | Move all ./source handling into CharSource, which will be reused by other device classes as well. This requires us to add ../ handling into our xmlapi xpath engine
* xmlbuilder: Validate root element of object parsexmlCole Robinson2019-05-131-0/+13
| | | | Ensure that for example a DeviceDisk is actually passed <disk> XML
* xmlapi: rename and move get_prop/set_prop to utilCole Robinson2019-05-101-32/+0
| | | | | Change to set_prop_path and get_prop_path to make it a bit more clear, and move out of xmlapi since it's not xml specific
* xmlapi: add set_propMarc Hartmayer2019-03-061-0/+16
| | | | | | | Introduce set_prop helper function. It will be used in the next patch. Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
* cli: refactor get_propMarc Hartmayer2019-03-061-0/+16
| | | | | | | | Refactor get_prop since it will be used in the next patches at other places as well. Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
* xmlapi: refactor node_is_text functionMarc Hartmayer2019-01-071-5/+6
| | | | | | | ...since it's used at least at three places. Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
* xmlapi: Rework xmlns setting slightlyCole Robinson2018-09-131-9/+14
| | | | | So the xmlns is not always set on the top element. We need this for custom <metadata> support
* xmlapi: Move namespace mappings to the relevant classesCole Robinson2018-09-131-3/+4
| | | | So we don't need to update xmlapi.py to account for additions
* Fix copyright header to specify GPLv2 or later, not GPLv2 only.Daniel P. Berrangé2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | The copyright headers in every file were chjanged in this previous commit commit b6dcee8eb7ec4de999058c187162fe4aedef36b4 Author: Cole Robinson <crobinso@redhat.com> Date: Tue Mar 20 15:00:02 2018 -0400 Use consistent and minimal license header for every file Where before this they said " "either version 2 of the License, or (at your option) any later version." Now they just say "GNU GPLv2" This fixes it to say "GNU GPLv2 or later" again. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Use consistent and minimal license header for every fileCole Robinson2018-03-211-14/+2
|
* xmlapi: Fix some pylintCole Robinson2018-02-201-1/+1
|
* xmlapi: Some libxml2 simplificationsCole Robinson2018-02-201-47/+12
|
* xmlbuilder: Abstract libxml2 API and cleanupCole Robinson2018-02-201-0/+415
Moves the libxml2 bits to a separate xmlapi file and class, a bunch of cleanups to xmlbuilder internals dealing with XML stuff. The main point is to experiment with different XML library impls, since libxml2 is unfun to deal with and we are having python3 issues like https://bugzilla.gnome.org/show_bug.cgi?id=776815