Skip to content

Commit

Permalink
Merge pull request #4837 from natefoo/pgcleanup-log-dir
Browse files Browse the repository at this point in the history
[17.09] Support a log directory argument for pgcleanup.py
  • Loading branch information
jmchilton committed Oct 23, 2017
2 parents 5016a2d + 646a8d1 commit 1af06ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/cleanup_datasets/pgcleanup.py
Expand Up @@ -72,6 +72,7 @@ def __parse_args(self):
parser.add_option('-U', '--no-update-time', action='store_false', dest='update_time', help="Don't set update_time on updated objects", default=True)
parser.add_option('-s', '--sequence', dest='sequence', help='Comma-separated sequence of actions, chosen from: %s' % self.action_names, default='')
parser.add_option('-w', '--work-mem', dest='work_mem', help='Set PostgreSQL work_mem for this connection', default=None)
parser.add_option('-l', '--log-dir', dest='log_dir', help='Log file directory', default=os.path.join(galaxy_root, 'scripts', 'cleanup_datasets'))
(self.options, self.args) = parser.parse_args()

self.options.sequence = [x.strip() for x in self.options.sequence.split(',')]
Expand Down Expand Up @@ -117,7 +118,7 @@ def __load_object_store(self):

def _open_logfile(self):
action_name = inspect.stack()[1][3]
logname = os.path.join(galaxy_root, 'scripts', 'cleanup_datasets', action_name + '.log')
logname = os.path.join(self.options.log_dir, action_name + '.log')

if self.options.dry_run:
log.debug('--dry-run specified, logging changes to stdout instead of log file: %s' % logname)
Expand Down

0 comments on commit 1af06ce

Please sign in to comment.