Skip unitialized repo's

These gave me errors which caused mails from crontab.
This commit is contained in:
mjonker-embed
2015-04-15 12:10:53 +02:00
parent e8aa38f395
commit 339ad96876

View File

@@ -357,6 +357,11 @@ def fetch_repository(name, remote_url, local_dir, skip_existing=False):
if clone_exists and skip_existing:
return
initalized = subprocess.call('git ls-remote ' + remote_url, stdout=FNULL, stderr=FNULL, shell=True)
if initalized == 128:
log_info("Skipping {} since it's not initalized".format(name))
return
if clone_exists:
log_info('Updating {} in {}'.format(name, local_dir))
git_command = ['git', 'fetch', '--all', '--tags', '--prune']