Permalink
Browse files

Don't fail webhook setup when no webhooks found

  • Loading branch information...
1 parent 1fa053b commit bf7a42e3a457c195003d478fb3bd0ccdbcb51e8b @spladug committed Sep 17, 2017
Showing with 7 additions and 2 deletions.
  1. +7 −2 harold/webhooks.py
View
@@ -1,12 +1,12 @@
#!/usr/bin/python
import argparse
+import ConfigParser
import getpass
import glob
import json
import posixpath
import socket
-import sys
import urlparse
import requests
@@ -65,7 +65,12 @@ def configure_webhooks_for_instance(access_token, config_filename, dry_run):
print "Processing %s" % config_filename
harold_config = HaroldConfiguration(config_filename)
- gh_config = GitHubConfig(harold_config)
+ try:
+ gh_config = GitHubConfig(harold_config)
+ except ConfigParser.NoSectionError:
+ print " No github configuration found!"
+ return
+
repositories = gh_config.repositories_by_name.keys()
if not repositories:
print " No repositories to register with!"

0 comments on commit bf7a42e

Please sign in to comment.