Commit 7dae6b02 by James Cammarata

Merge pull request #7814 from…

Merge pull request #7814 from scottbrown/bugfix-7811-mysql_import_does_not_perform_dump_existence_check

BUGFIX for Issue 7811: Adding file existence check when performing mysql import on...
parents b5ea0246 28c9104e
......@@ -140,6 +140,9 @@ def db_dump(module, host, user, password, db_name, target, port, socket=None):
return rc, stdout, stderr
def db_import(module, host, user, password, db_name, target, port, socket=None):
if not os.path.exists(target):
return module.fail_json(msg="target %s does not exist on the host" % target)
cmd = module.get_bin_path('mysql', True)
cmd += " --user=%s --password=%s" % (pipes.quote(user), pipes.quote(password))
if socket is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment