Skip to content

Commit

Permalink
Merge pull request #147 from sthirugn/foreman-debug-update
Browse files Browse the repository at this point in the history
Ability to generate foreman-debug in specific local folder
  • Loading branch information
sthirugn committed Feb 18, 2015
2 parents aadfffc + 4f6a3f6 commit 047d5e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions automation_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,12 +1460,15 @@ def update_packages(*args, **kwargs):
# =============================================================================
# Utility tasks
# =============================================================================
def foreman_debug(tarball_name=None):
def foreman_debug(tarball_name=None, local_path=None):
"""Generates and download the foreman-debug generated tarball
:param str tarball_name: The tarball file name which will be downloaded
relative to the current working directory. If ``None`` the tarball will
be named foreman-debug-<timestamp>.
:param str local_path: The local path given by user to save foreman-debug
tar file eg., /home/$user/Downloads/. By default, the tar file will
be saved in automation-tools root folder.
"""
if tarball_name is None:
Expand All @@ -1474,7 +1477,7 @@ def foreman_debug(tarball_name=None):
with cd('/tmp'):
run('foreman-debug -q -d {0}'.format(tarball_name), quiet=True)
get(
local_path='%(basename)s',
local_path=local_path if local_path else '%(basename)s',
remote_path='/tmp/{0}/{0}.tar.xz'.format(tarball_name),
)

Expand Down

0 comments on commit 047d5e4

Please sign in to comment.