예제 #1
0
 def estimate_backup_size(self):
     try:
         client = MySQL.from_defaults(self.defaults_path)
     except MySQL.MySQLError as exc:
         raise BackupError('Failed to connect to MySQL [%d] %s' % exc.args)
     try:
         try:
             datadir = client.var('datadir')
             return directory_size(datadir)
         except MySQL.MySQLError as exc:
             raise BackupError("Failed to find mysql datadir: [%d] %s" %
                               exc.args)
         except OSError as exc:
             raise BackupError(
                 'Failed to calculate directory size: [%d] %s' %
                 (exc.errno, exc.strerror))
     finally:
         client.close()
예제 #2
0
 def estimate_backup_size(self):
     """Return estimated backup size"""
     try:
         client = MySQL.from_defaults(self.defaults_path)
     except MySQL.MySQLError as exc:
         raise BackupError("Failed to connect to MySQL [%d] %s" % exc.args)
     try:
         try:
             datadir = client.var("datadir")
             return directory_size(datadir)
         except MySQL.MySQLError as exc:
             raise BackupError("Failed to find mysql datadir: [%d] %s" % exc.args)
         except OSError as exc:
             raise BackupError(
                 "Failed to calculate directory size: [%d] %s" % (exc.errno, exc.strerror)
             )
     finally:
         client.close()
예제 #3
0
파일: plugin.py 프로젝트: rcleere/holland
 def estimate_backup_size(self):
     try:
         client = MySQL.from_defaults(self.defaults_path)
     except MySQL.MySQLError, exc:
         raise BackupError("Failed to connect to MySQL [%d] %s" % exc.args)
예제 #4
0
 def estimate_backup_size(self):
     try:
         client = MySQL.from_defaults(self.defaults_path)
     except MySQL.MySQLError, exc:
         raise BackupError('Failed to connect to MySQL [%d] %s' % exc.args)