Fixed things suggested in the pull request.
This commit is contained in:
parent
cde1f32b61
commit
3103efbb43
@ -48,11 +48,11 @@ def create_method_args_string(*args, **kwargs):
|
||||
I.e. for args=1,2,3 and kwargs={'a':4, 'b':5} you'd get: "1,2,3,a=4,b=5"
|
||||
"""
|
||||
# While %s turns a var into a string but in some rare cases explicit
|
||||
# str() is less likely to raise an exception.
|
||||
# repr() is less likely to raise an exception.
|
||||
arg_strs = [repr(arg) for arg in args]
|
||||
arg_strs += ['%s=%s' % (repr(key), repr(value))
|
||||
for (key, value) in kwargs.items()]
|
||||
return ','.join(arg_strs)
|
||||
return ', '.join(arg_strs)
|
||||
|
||||
|
||||
def stringify_keys(dictionary):
|
||||
|
@ -690,21 +690,25 @@ class MySqlApp(object):
|
||||
tmp_file.close()
|
||||
|
||||
def wipe_ib_logfiles(self):
|
||||
"""Destroys the iblogfiles.
|
||||
|
||||
If for some reason the selected log size in the conf changes from the
|
||||
current size of the files MySQL will fail to start, so we delete the
|
||||
files to be safe.
|
||||
"""
|
||||
LOG.info(_("Wiping ib_logfiles..."))
|
||||
def delete_log(index):
|
||||
# On restarts, sometimes these are wiped. So it can be a race to
|
||||
# have MySQL start up before it's restarted and these have to be
|
||||
# deleted. That's why its ok if they aren't found.
|
||||
for index in range(2):
|
||||
try:
|
||||
utils.execute_with_timeout("sudo", "rm", "%s/ib_logfile%d"
|
||||
% (MYSQL_BASE_DIR, index))
|
||||
except ProcessExecutionError as pe:
|
||||
# On restarts, sometimes these are wiped. So it can be a race
|
||||
# to have MySQL start up before it's restarted and these have
|
||||
# to be deleted. That's why its ok if they aren't found.
|
||||
LOG.error("Could not delete logfile!")
|
||||
LOG.error(pe)
|
||||
if "No such file or directory" not in str(pe):
|
||||
raise
|
||||
delete_log(0)
|
||||
delete_log(1)
|
||||
|
||||
def _write_mycnf(self, pkg, update_memory_mb, admin_password):
|
||||
"""
|
||||
|
@ -58,7 +58,7 @@ class InstanceTasks(object):
|
||||
NONE = InstanceTask(0x01, 'NONE')
|
||||
DELETING = InstanceTask(0x02, 'DELETING')
|
||||
REBOOTING = InstanceTask(0x03, 'REBOOTING')
|
||||
RESIZING = InstanceTask(0x03, 'RESIZING')
|
||||
RESIZING = InstanceTask(0x04, 'RESIZING')
|
||||
|
||||
|
||||
# Dissuade further additions at run-time.
|
||||
|
Loading…
x
Reference in New Issue
Block a user