← Back to team overview

holland-coredev team mailing list archive

[Bug 1525928] [NEW] On Fedora 22, Holland fails with Python error

 

Public bug reported:

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.

** Affects: holland-backup
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Holland
Build, which is subscribed to holland-backup.
https://bugs.launchpad.net/bugs/1525928

Title:
  On Fedora 22, Holland fails with Python error

Status in holland-backup:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/holland-backup/+bug/1525928/+subscriptions