Skip to content

Commit

Permalink
CLI: support a timout option
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed Oct 26, 2014
1 parent 9744475 commit 1672529
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -14,3 +14,4 @@ Koen Smets <koen.smets@gmail.com>
Mart Sõmermaa <mart.somermaa@cgi.com>
Diego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br>
Crestez Dan Leonard <lcrestez@ixiacom.com>
Patrick Miller <patrick@velocitywebworks.com>
12 changes: 11 additions & 1 deletion gitlab
Expand Up @@ -141,7 +141,7 @@ def usage():
def do_auth():
try:
gl = gitlab.Gitlab(gitlab_url, private_token=gitlab_token,
ssl_verify=ssl_verify)
ssl_verify=ssl_verify, timeout=timeout)
gl.auth()
except:
die("Could not connect to GitLab (%s)" % gitlab_url)
Expand Down Expand Up @@ -247,6 +247,7 @@ def do_project_owned():


ssl_verify = True
timeout = 60
gitlab_id = None
verbose = False

Expand Down Expand Up @@ -325,6 +326,15 @@ try:
except:
pass

try:
timeout = config.getboolean('global', 'timeout')
except:
pass
try:
timeout = config.getboolean(gitlab_id, 'timeout')
except:
pass

try:
what = args.pop(0)
action = args.pop(0)
Expand Down

3 comments on commit 1672529

@godmar
Copy link

@godmar godmar commented on 1672529 Feb 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? timeout is a number, but you read it with 'config.getboolean'?

@godmar
Copy link

@godmar godmar commented on 1672529 Feb 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using int(config.get(...)) instead.

@gpocentek
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I just pushed a fix. Thanks!

Please sign in to comment.