[PATCH python] Deal with old filenames for events/error functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Older libvirt has files named 'events' and 'virterror'
rather than 'virevent' and 'virerror'. This is visible
in the API XML files. We must look for both names to
ensure we don't loose generation of methods with older
versions of libvirt.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 generator.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/generator.py b/generator.py
index 273efbd..cd857b4 100755
--- a/generator.py
+++ b/generator.py
@@ -113,7 +113,8 @@ class docParser(xml.sax.handler.ContentHandler):
         elif tag == 'enum':
             # enums come from header files, hence virterror.h
             if (attrs['file'] == "libvirt" or
-                attrs['file'] == "virterror"):
+                attrs['file'] == "virterror" or
+                attrs['file'] == "virerror"):
                 enum(attrs['type'],attrs['name'],attrs['value'])
             elif attrs['file'] == "libvirt-lxc":
                 lxc_enum(attrs['type'],attrs['name'],attrs['value'])
@@ -127,8 +128,10 @@ class docParser(xml.sax.handler.ContentHandler):
             # fuctions come from source files, hence 'virerror.c'
             if self.function is not None:
                 if (self.function_module == "libvirt" or
+                    self.function_module == "event" or
                     self.function_module == "virevent" or
-                    self.function_module == "virerror"):
+                    self.function_module == "virerror" or
+                    self.function_module == "virterror"):
                     function(self.function, self.function_descr,
                              self.function_return, self.function_args,
                              self.function_file, self.function_module,
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]