@@ -76,9 +76,7 @@ def _list_dir_files_nginx(self, dirpath):
76
76
directory
77
77
"""
78
78
basedir = get_db_files_base_dir ()
79
- basedir_len = len (basedir )
80
- if not basedir .endswith ('/' ):
81
- basedir_len += 1
79
+ basedir_len = len (basedir ) + 1
82
80
to_download = []
83
81
for dp , _ , fps in walk (dirpath ):
84
82
for fn in fps :
@@ -103,9 +101,7 @@ def _list_artifact_files_nginx(self, artifact):
103
101
The path information needed by nginx for each file in the artifact
104
102
"""
105
103
basedir = get_db_files_base_dir ()
106
- basedir_len = len (basedir )
107
- if not basedir .endswith ('/' ):
108
- basedir_len += 1
104
+ basedir_len = len (basedir ) + 1
109
105
to_download = []
110
106
for i , x in enumerate (artifact .filepaths ):
111
107
# ignore if tgz as they could create problems and the
@@ -432,9 +428,7 @@ def get(self):
432
428
sort = 'descending' )[0 ]
433
429
434
430
basedir = get_db_files_base_dir ()
435
- basedir_len = len (basedir )
436
- if not basedir .endswith ('/' ):
437
- basedir_len += 1
431
+ basedir_len = len (basedir ) + 1
438
432
fp = x ['fp' ][basedir_len :]
439
433
to_download .append ((fp , fp , '-' , str (x ['fp_size' ])))
440
434
self ._write_nginx_file_list (to_download )
0 commit comments