[libvirt] [PATCH] python: Fix libvirt.py generation to include virterror info

Recent generator refactoring broke libvirt.py. With this patch, libvirt.py is generated exactly the same as before the offending commit. --- python/generator.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/generator.py b/python/generator.py index 327e1d5..d855d6b 100755 --- a/python/generator.py +++ b/python/generator.py @@ -120,7 +120,8 @@ class docParser(xml.sax.handler.ContentHandler): if attrs.has_key('field'): self.function_return_field = attrs['field'] elif tag == 'enum': - if attrs['file'] == "libvirt": + if (attrs['file'] == "libvirt" or + attrs['file'] == "virterror"): enum(attrs['type'],attrs['name'],attrs['value']) elif attrs['file'] == "libvirt-qemu": qemu_enum(attrs['type'],attrs['name'],attrs['value']) @@ -130,7 +131,9 @@ class docParser(xml.sax.handler.ContentHandler): print "end %s" % tag if tag == 'function': if self.function != None: - if self.function_module == "libvirt": + if (self.function_module == "libvirt" or + self.function_module == "event" or + self.function_module == "virterror"): function(self.function, self.function_descr, self.function_return, self.function_args, self.function_file, self.function_module, -- 1.7.4.4

On 09/14/2011 04:27 PM, Cole Robinson wrote:
Recent generator refactoring broke libvirt.py. With this patch, libvirt.py is generated exactly the same as before the offending commit. --- python/generator.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
Just to be clear, we definitely want this before release, since the effect of this bug is that all python error reporting throws a traceback. Thanks, Cole
diff --git a/python/generator.py b/python/generator.py index 327e1d5..d855d6b 100755 --- a/python/generator.py +++ b/python/generator.py @@ -120,7 +120,8 @@ class docParser(xml.sax.handler.ContentHandler): if attrs.has_key('field'): self.function_return_field = attrs['field'] elif tag == 'enum': - if attrs['file'] == "libvirt": + if (attrs['file'] == "libvirt" or + attrs['file'] == "virterror"): enum(attrs['type'],attrs['name'],attrs['value']) elif attrs['file'] == "libvirt-qemu": qemu_enum(attrs['type'],attrs['name'],attrs['value']) @@ -130,7 +131,9 @@ class docParser(xml.sax.handler.ContentHandler): print "end %s" % tag if tag == 'function': if self.function != None: - if self.function_module == "libvirt": + if (self.function_module == "libvirt" or + self.function_module == "event" or + self.function_module == "virterror"): function(self.function, self.function_descr, self.function_return, self.function_args, self.function_file, self.function_module,

On 09/14/2011 02:27 PM, Cole Robinson wrote:
Recent generator refactoring broke libvirt.py. With this patch, libvirt.py is generated exactly the same as before the offending commit.
Mention the actual commit that caused the regression: 9eba0d25. ACK With that nit fixed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 09/14/2011 05:35 PM, Eric Blake wrote:
On 09/14/2011 02:27 PM, Cole Robinson wrote:
Recent generator refactoring broke libvirt.py. With this patch, libvirt.py is generated exactly the same as before the offending commit.
Mention the actual commit that caused the regression: 9eba0d25.
ACK With that nit fixed.
Thanks, pushed now. - Cole
participants (2)
-
Cole Robinson
-
Eric Blake