From 07b89fe2ff0b1c7f1ce2d25a8918612470a71725 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Sun, 21 Oct 2012 19:46:33 +0100 Subject: roomservice: Handle missing netrc file Change-Id: If981fe79dc3e2191434301239b0cd585be8b4730 --- tools/roomservice.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/roomservice.py b/tools/roomservice.py index c1979ef..bc3a809 100755 --- a/tools/roomservice.py +++ b/tools/roomservice.py @@ -38,11 +38,14 @@ if not depsonly: repositories = [] -authtuple = netrc.netrc().authenticators("api.github.com") +try: + authtuple = netrc.netrc().authenticators("api.github.com") -if authtuple: - githubauth = base64.encodestring('%s:%s' % (authtuple[0], authtuple[2])).replace('\n', '') -else: + if authtuple: + githubauth = base64.encodestring('%s:%s' % (authtuple[0], authtuple[2])).replace('\n', '') + else: + githubauth = None +except: githubauth = None page = 1 -- cgit v1.1