Wednesday, February 8, 2017

python-bugzilla 2.0.0 released!

I'm happy to announce a new release of python-bugzilla, version 2.0.0.

This release contains several small to medium API breaks as previously mentioned on the blog. If you hit any issues, check that page first to see if it's an expected change.
The major changes in the release are:
  • Several fixes for use with bugzilla 5
  • This release contains several smallish API breaks:
  • Bugzilla.bug_autorefresh now defaults to False
  • Credentials are now cached in ~/.cache/python-bugzilla/
  • bin/bugzilla was converted to argparse
  • bugzilla query --boolean_chart option is removed
  • Unify command line flags across sub commands
  • More details at:

Wednesday, June 29, 2016

UEFI virt roms now in official Fedora repos

Kamil got to it first, but just a note that UEFI roms for x86 and aarch64 virt are now shipped in the standard Fedora repos, where previously the recommended place to grab them was an external nightly repo. Kamil has updated the UEFI+QEMU wiki page to reflect this change.

On up to date Fedora 23+ these roms will be installed automatically with the relevant qemu packages, and libvirt is properly configured to advertise the rom files to applications, so enabling this with tools like virt-manager is available out of the box.

For the curious, the reason we can now ship these binaries in Fedora is because the problematic EDK2 'FatPkg' code, which had a Fedora incompatible license, was replaced with an implementation with a less restrictive (and more Fedora friendly) license.

Saturday, June 18, 2016

virt-manager 1.4.0 release

I've just released virt-manager 1.4.0. Besides the spice GL bits that I previously talked about, nothing too much exciting in this release except a lot of virt-install/virt-xml command line extensions.

The changelog highlights:
  • virt-manager: spice GL console support (Marc-André Lureau, Cole Robinson)
  • Bump gtk and pygobject deps to 3.14
  • virt-manager: add checkbox to forget keyring password (Pavel Hrdina)
  • cli: add --graphics gl= (Marc-André Lureau)
  • cli: add --video accel3d= (Marc-André Lureau)
  • cli: add --graphics listen=none (Marc-André Lureau)
  • cli: add --transient flag (Richard W.M. Jones)
  • cli: --features gic= support, and set a default for it (Pavel Hrdina)
  • cli: Expose --video heads, ram, vram, vgamem
  • cli: add --graphics listen=socket
  • cli: add device address.type/address.bus/...
  • cli: add --disk seclabelX.model (and .label, .relabel)
  • cli: add --cpu (and .cpus, and .memory)
  • cli: add --network rom_bar= and rom_file=
  • cli: add --disk backing_format=

Friday, June 10, 2016

check-pylint: mini tool for running pylint anywhere

pylint and pep8 are indispensable tools for python development IMO. For projects I maintain I've long ago added a 'setup pylint' sub-command to run both commands, and I've documented this as a necessary step in the contributor guidelines.

But over the years I've accumulated many repos for small bits of python code that never have need for a script, but I still want the convenience of being able to run pylint and pep8 with a single command and a reasonable set of options.

So, a while back I wrote this tiny 'check-pylint' script which does exactly that. The main bit it adds is automatically searching the current directory for python scripts and modules and passing them to pylint/pep8. From the README:

Simple helper script that scoops up all python modules and scripts beneath the current directory, and passes them through pylint and pep8. Has a bit of smarts to ignore .git directory, and handle files that don't end in .py

The point is that you can just fire off 'check-pylint' in any directory containing python code and get a quick report.

Tuesday, June 7, 2016

python-bugzilla API changes in git

I've made a number of API changes to python-bugzilla in git. Most of it is removing old mis-designed features which I don't think anyone is actually using. I went through all apps I know of that use python-bugzilla (fedora bits like bodhi pkgdb infra scripts, bugwarrior, to confirm as much and I don't think anything below will affect them. Even if there's no complaints I won't cut the release for 4-6 weeks.

The list is long but most changes are fairly straight forward. If any of this sounds controversial, or if I misjudged one of the 'unused' bits and should reconsider, please leave your thoughts here or on the python-bugzilla mailing list.

The interesting change is:
  • Bugzilla.bug_autorefresh now defaults to False. Previously if trying to access, and 'foo' wasn't cached, the Bug() object would basically do a Bug.refresh() and fetch all the bug contents from the server. This default sucks, it can lead to poorly performing scripts and unnecessary bugzilla load. If you have code that uses include_fields, exclude_fields, or extra_fields anywhere, this change may affect you. You can set Bugzilla().bug_autorefresh = False before doing any bug lookup to force this off (with current versions) and catch any errors. If you hit issues you probably need to extend your include_fields specifications. The reason for this change is that the old pattern made it too easy for people's scripts to unintentionally start requiring a much higher number of XMLRPC calls, thus completely negating the usage of include_fields in the first place. Some more details over here:

These are slightly interesting and may impact a few people:
  • Credentials are now cached in ~/.cache/python-bugzilla/. If the old ~/.bugzilla{cookies,token} files are in place we will continue to update and use them. * RHBugzilla.rhbz_back_compat __init__ attribute is gone. If the user manually set this to true, we would alter some Bug fields returned via query() to convert python lists into a single comma separated string, to match rhbugzilla output from before the 2012 upgrade. Convert your code to use the modern bugzilla list output.
  • bin/bugzilla was converted to argparse, which has a bug on python 2.7 that affects some possible command lines: If you use a command like 'bugzilla modify --cc' to remove that email from the CC list, you now need to ensure there's an equals sign in there, like That is backwards compatible with old python-bugzilla too, so update your scripts now. A few other options expect that format too.
  • bugzilla query --boolean_chart option is removed. It provided a custom specification for crafting complex queries, similar to what the bugzilla UI can do. I don't think anyone is really using this, but if you are, generate a web query URL and pass it to bugzilla query --from-url '$URL' which is much easier to deal with.
  • bugzilla query 'boolean' options, where you could say 'bugzilla query --keywords 'foo & bar' to match both substrings, are no longer supported. If you need logic like this, use the --from-url technique mentioned above.
  • Bug.get_history() is now Bug.get_history_raw() Bugzilla.bugs_history is now Bugzilla.bugs_history_raw() This API is only a year old and unwisely returns raw output from bugzilla, which has some formatting oddities. I renamed it to *_raw so we have the future opportunity to add an API with better output.
  • The getbugsimple and getbugssimple APIs were removed. They were basically just wrappers around standard getbug() at this point. Use getbug/getbugs instead.
  • The simplequery API was removed. This basically matches the basic query from the bugzilla front page. Just use the standard query methods instead, see examples/ from git. I didn't find any users of this function.
  • Various whiteboard editing functions from the Bug object were removed. - getwhiteboard: this is just a wrapper around standard Bug attributes - appendwhiteboard, prependwhiteboard, setwhiteboard: these were just wrappers around standard build_update/update_bugs - addtag/gettags/deltag which minor wrappers around the *whiteboard functions, and were poorly named, given that there's an actual bug 'tags' field at this point. See examples/ from git for examples of using the standard update APIs. That said I've never heard of anyone actually using these, and they were designed around really old RHBZ APIs.

These I doubt will actually affect anyone:
  • Bugzilla.initcookie() dropped... use Bugzilla.cookiefile = X instead 
  • Bugzilla.adduser() dropped... it was the same as Bugzilla.createuser 
  • RHBugzilla.multicall __init__ attribute is gone. It's been a no-op and raises a warning for a long time. 
  • Bugzilla.version string is gone... this was meant to describe the python-bugzilla API version but was never used. 
  • Initing like Bugzilla() with no options was previously allowed, but now requires an explicit Bugzilla(url=None). 
  • We no longer handle cookies in LWP format. We've been silently converting them to mozilla format for 2 years so I assume this doesn't affect anyone, but if it does, you might need to delete your caches in ~/.bugzilla{cookies,token} 
  • Bug.setstatus(), Bug.close() args 'private_in_it' and 'nomail' were removed: they have been no-ops for years 
  • Bug.addcomment() args 'timestamp', 'bz_gid' and 'worktime' were removed: they've been no-ops for years
  • Bug.setassignee() arg 'reporter' was removed: it's thrown an error for years