On Fedora 22, Holland fails with Python error

Bug #1525928 reported by Danny Attar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
holland-backup
New
Undecided
Unassigned

Bug Description

At Fedora 22, it seems that Python 2.7 is stricter about the syntax for single-element tuples.
Using the mysqldump plugin and Holland 1.0.10-3.fc22, the result was:

Uncaught exception while running command 'bk': TypeError('not all arguments converted during string formatting',)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/holland/core/command/command.py", line 209, in dispatch
    return self.run(self.optparser.prog, opts, *args)
  File "/usr/lib/python2.7/site-packages/holland/commands/backup.py", line 102, in run
    runner.backup(name, config, opts.dry_run)
  File "/usr/lib/python2.7/site-packages/holland/core/backup/base.py", line 120, in backup
    estimated_size = self.check_available_space(plugin, spool_entry, dry_run)
  File "/usr/lib/python2.7/site-packages/holland/core/backup/base.py", line 213, in check_available_space
    estimated_bytes_required = plugin.estimate_backup_size()
  File "/usr/lib/python2.7/site-packages/holland/backup/mysqldump/plugin.py", line 123, in estimate_backup_size
    self.schema.refresh(db_iter=db_iter, tbl_iter=tbl_iter)
  File "/usr/lib/python2.7/site-packages/holland/lib/mysql/schema/base.py", line 135, in refresh
    for table in tbl_iter(database.name):
  File "/usr/lib/python2.7/site-packages/holland/lib/mysql/schema/base.py", line 293, in __call__
    for metadata in self.client.show_table_metadata(database):
  File "/usr/lib/python2.7/site-packages/holland/lib/mysql/client/base.py", line 198, in show_table_metadata
    return self._show_table_metadata51(database)
  File "/usr/lib/python2.7/site-packages/holland/lib/mysql/client/base.py", line 181, in _show_table_metadata51
    cursor.execute(sql, (database))
  File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 202, in execute
    query = query % args
TypeError: not all arguments converted during string formatting

Changing line 181 of /usr/lib/python2.7/site-packages/holland/lib/mysql/client/base.py from:

        cursor.execute(sql, (database))

to:

         cursor.execute(sql, (database,))

fixes the problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.