fix: timmy fails in "mdir" when using --dest-file

Closes-Bug: https://github.com/adobdin/timmy/issues/68
Change-Id: I0454416896d17b45bd756cb4cc40ac8d3c60193f
This commit is contained in:
Dmitry Sutyagin 2016-11-22 18:44:10 -08:00
parent de323f534b
commit 6eb8f52c11
3 changed files with 5 additions and 2 deletions

View File

@ -282,6 +282,9 @@ def main(argv=None):
conf['dir_timestamp'] = True conf['dir_timestamp'] = True
if args.dest_file: if args.dest_file:
conf['archive_dir'] = os.path.split(args.dest_file)[0] conf['archive_dir'] = os.path.split(args.dest_file)[0]
if not conf['archive_dir']:
# this is mainly to see the path in logs instad of ""
conf['archive_dir'] = os.getcwd()
conf['archive_name'] = os.path.split(args.dest_file)[1] conf['archive_name'] = os.path.split(args.dest_file)[1]
logger.info('Using rqdir: %s, rqfile: %s' % logger.info('Using rqdir: %s, rqfile: %s' %
(conf['rqdir'], conf['rqfile'])) (conf['rqdir'], conf['rqfile']))

View File

@ -16,7 +16,7 @@
# under the License. # under the License.
project_name = 'timmy' project_name = 'timmy'
version = '1.23.2' version = '1.23.3'
if __name__ == '__main__': if __name__ == '__main__':
import sys import sys

View File

@ -264,7 +264,7 @@ def mdir(directory):
""" """
Creates a directory if it doesn't exist Creates a directory if it doesn't exist
""" """
if not os.path.exists(directory): if directory and not os.path.exists(directory):
logger.debug('creating directory %s' % directory) logger.debug('creating directory %s' % directory)
try: try:
os.makedirs(directory) os.makedirs(directory)