~gnuoy/charms/trusty/percona-cluster/sstpasswd2

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/database/mysql.py

  • Committer: Jorge Niedbalski
  • Date: 2015-03-04 17:42:16 UTC
  • mfrom: (51.1.1 percona-cluster)
  • Revision ID: jorge.niedbalski@canonical.com-20150304174216-t3ve88ssrkbf73b6
[jjo, r=niedbalski] Fixes bug lp: #1386791.
- sync charmhelpers, then expose wait-timeout config

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
"""Helper for working with a MySQL database"""
2
2
import json
3
 
import socket
4
3
import re
5
4
import sys
6
5
import platform
22
21
    log,
23
22
    DEBUG,
24
23
    INFO,
25
 
    WARNING,
26
24
)
27
25
from charmhelpers.fetch import (
28
26
    apt_install,
359
357
        if 'max-connections' in config:
360
358
            mysql_config['max_connections'] = config['max-connections']
361
359
 
 
360
        if 'wait-timeout' in config:
 
361
            mysql_config['wait_timeout'] = config['wait-timeout']
 
362
 
362
363
        # Set a sane default key_buffer size
363
364
        mysql_config['key_buffer'] = self.human_to_bytes('32M')
364
365
        total_memory = self.human_to_bytes(self.get_mem_total())