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...
reviewable/pr18780/r1
James Cammarata 11 years ago
commit 5349b2b06d

@ -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:

Loading…
Cancel
Save