Skip to content

Commit

Permalink
Merge pull request #967 from anusha-r/deprecated-warning
Browse files Browse the repository at this point in the history
Deprecated warning
  • Loading branch information
David Marin committed Mar 8, 2015
2 parents 95a399a + 2e61c0d commit 3b90431
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mrjob/emr.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ def __init__(self, **kwargs):
'args': args[1:],
})

if self._opts['bootstrap_files']:
log.warning("bootstrap_files is deprecated since v0.4.2 and will be removed in v0.6.0. Consider using bootstrap instead.")
for path in self._opts['bootstrap_files']:
self._bootstrap_dir_mgr.add(**parse_legacy_hash_path(
'file', path, must_name='bootstrap_files'))
Expand Down Expand Up @@ -1958,6 +1960,9 @@ def _parse_legacy_bootstrap(self):
# job flow creation time so we call both
bootstrap.append(['sudo apt-get install -y python-pip || '
'sudo yum install -y python-pip'])
# Print a warning
log.warning("bootstrap_python_packages is deprecated since v0.4.2 and will be removed in v0.6.0. Consider using bootstrap instead.")


for path in self._opts['bootstrap_python_packages']:
path_dict = parse_legacy_hash_path('file', path)
Expand All @@ -1966,12 +1971,17 @@ def _parse_legacy_bootstrap(self):
bootstrap.append(['sudo pip install ', path_dict])

# setup_cmds
if self._opts['bootstrap_cmds']:
log.warning("bootstrap_cmds is deprecated since v0.4.2 and will be removed in v0.6.0. Consider using bootstrap instead.")
for cmd in self._opts['bootstrap_cmds']:
if not isinstance(cmd, basestring):
cmd = cmd_line(cmd)
bootstrap.append([cmd])

# bootstrap_scripts
if self._opts['bootstrap_scripts']:
log.warning("bootstrap_scripts is deprecated since v0.4.2 and will be removed in v0.6.0. Consider using bootstrap instead.")

for path in self._opts['bootstrap_scripts']:
path_dict = parse_legacy_hash_path('file', path)
bootstrap.append([path_dict])
Expand Down
6 changes: 6 additions & 0 deletions mrjob/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,12 +959,18 @@ def _parse_setup(self):
setup.append(parse_setup_cmd(cmd))

# setup_cmds
if self._opts['setup_cmds']:
log.warning("setup_cmds is deprecated since v0.4.2 and will be removed in v0.6.0. Consider using setup instead.")

for cmd in self._opts['setup_cmds']:
if not isinstance(cmd, basestring):
cmd = cmd_line(cmd)
setup.append([cmd])

# setup_scripts
if self._opts['setup_scripts']:
log.warning("setup_scripts is deprecated since v0.4.2 and will be removed in v0.6.0. Consider using setup instead.")

for path in self._opts['setup_scripts']:
path_dict = parse_legacy_hash_path('file', path)
setup.append([path_dict])
Expand Down

0 comments on commit 3b90431

Please sign in to comment.