Small GC changes

This commit is contained in:
Dmitry Petrov
2017-06-27 02:53:00 -07:00
parent 059fcc028d
commit a588d71a83
5 changed files with 19 additions and 6 deletions
+8
View File
@@ -53,6 +53,14 @@ class CmdGC(Traverse):
def gc_all(self):
return self._traverse_all()
@property
def no_git_actions(self):
return True
@staticmethod
def not_committed_changes_warning():
pass
if __name__ == '__main__':
Runtime.run(CmdGC)
-1
View File
@@ -39,7 +39,6 @@ class Traverse(CmdBase):
return False
error = False
print('TARGET={}'.format(self.parsed_args.target))
for target in self.parsed_args.target:
if not self._traverse(target):
error = True
+4 -2
View File
@@ -242,7 +242,8 @@ class DataCloudAWS(DataCloudBase):
key_name = self.cache_file_key(item.resolved_cache.dvc)
key = bucket.get_key(key_name)
if not key:
raise DataCloudError('File "{}" does not exist in the cloud'.format(key_name))
Logger.error('File "{}" does not exist in the cloud'.format(key_name))
return
Logger.info('Downloading cache file from S3 "{}/{}"'.format(bucket.name, key_name))
key.get_contents_to_filename(item.resolved_cache.relative,
@@ -320,7 +321,8 @@ class DataCloudGCP(DataCloudBase):
blob = bucket.get_blob(key)
if not blob:
raise DataCloudError('File "{}" does not exist in the cloud'.format(key))
Logger.error('File "{}" does not exist in the cloud'.format(key))
return
Logger.info('Downloading cache file from gc "{}/{}"'.format(bucket.name, key))
+4 -1
View File
@@ -15,6 +15,7 @@ from dvc.command.run import CmdRun
from dvc.command.repro import CmdRepro
from dvc.command.data_sync import CmdDataSync
from dvc.command.lock import CmdLock
from dvc.command.gc import CmdGC
from dvc.command.test import CmdTest
VERSION = '0.8.5'
@@ -39,7 +40,7 @@ def print_usage():
def main():
cmds = ['--help', '--version', 'init', 'run', 'sync', 'repro', 'data', 'remove', 'import', 'lock', 'cloud', \
'cloud', 'cloud-run', 'cloud-instance-create', 'cloud-instance-remove', 'cloud-instance-describe', \
'test', 'test-aws', 'test-gcloud', 'test-cloud']
'test', 'test-aws', 'test-gcloud', 'test-cloud', 'gc']
if len(sys.argv) < 2 or sys.argv[1] not in cmds:
if len(sys.argv) >= 2:
@@ -67,6 +68,8 @@ def main():
Runtime.run(CmdRemove)
elif cmd == 'lock':
Runtime.run(CmdLock)
elif cmd == 'gc':
Runtime.run(CmdGC)
elif cmd == 'cloud-run':
print('cloud-run unimplemented')
elif cmd == 'cloud-instance-create':
+3 -2
View File
@@ -119,7 +119,8 @@ class RepositoryChange(object):
for root, dirs, files in os.walk(self._settings.config.data_dir):
for file in files:
filename = os.path.join(root, file)
timestemp = os.path.getmtime(filename)
res.add((filename, timestemp))
if os.path.exists(filename):
timestemp = os.path.getmtime(filename)
res.add((filename, timestemp))
return res