summaryrefslogtreecommitdiffstats
path: root/gitautodeploy/gitautodeploy.py
diff options
context:
space:
mode:
authorOliver Poignant <oliver@poignant.se>2016-08-26 22:56:05 +0200
committerOliver Poignant <oliver@poignant.se>2016-08-26 22:56:05 +0200
commit027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e (patch)
tree5f6abcaad3a34aa9bace3d1f1abe175202a4091c /gitautodeploy/gitautodeploy.py
parentd23233780c4223404b9585b52d3bc993b5626b67 (diff)
downloadGit-Auto-Deploy-027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e.zip
Git-Auto-Deploy-027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e.tar.gz
Git-Auto-Deploy-027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e.tar.bz2
Breaks when using logger in config module
Revert "Move config checks into cli/config module" This reverts commit 7720ec0cf45bb0b44e3e5b56116545237918d448.
Diffstat (limited to 'gitautodeploy/gitautodeploy.py')
-rw-r--r--gitautodeploy/gitautodeploy.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/gitautodeploy/gitautodeploy.py b/gitautodeploy/gitautodeploy.py
index 5d67851..8347d6a 100644
--- a/gitautodeploy/gitautodeploy.py
+++ b/gitautodeploy/gitautodeploy.py
@@ -97,6 +97,18 @@ class GitAutoDeploy(object):
# Iterate over all configured repositories
for repo_config in self._config['repositories']:
+ # Only clone repositories with a configured path
+ if 'url' not in repo_config:
+ logger.critical("Repository has no configured URL")
+ self.close()
+ self.exit()
+ return
+
+ # Only clone repositories with a configured path
+ if 'path' not in repo_config:
+ logger.debug("Repository %s will not be cloned (no path configured)" % repo_config['url'])
+ continue
+
if os.path.isdir(repo_config['path']) and os.path.isdir(repo_config['path']+'/.git'):
GitWrapper.init(repo_config)
else:
@@ -455,10 +467,7 @@ def main():
config['repositories'].append(repo_config)
# Initialize config by expanding with missing values
- if init_config(config) != 0:
- app.close()
- app.exit()
- return
+ init_config(config)
app.setup(config)
app.serve_forever()