mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
dvc: factory: check if file inside state dir has proper suffix
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+7
-1
@@ -55,7 +55,13 @@ class PathFactory(object):
|
||||
|
||||
for root, dirs, files in os.walk(self._config.state_dir):
|
||||
for fname in files:
|
||||
states.append(os.path.join(root, fname))
|
||||
path = os.path.join(root, fname)
|
||||
|
||||
if not fname.endswith(DataItem.STATE_FILE_SUFFIX):
|
||||
Logger.warn('Found file \'{}\' without state suffix inside state dir'.format(path))
|
||||
continue
|
||||
|
||||
states.append(path)
|
||||
|
||||
for state in states:
|
||||
data = os.path.relpath(state, self._config.state_dir)[:-len(DataItem.STATE_FILE_SUFFIX)]
|
||||
|
||||
Reference in New Issue
Block a user