[sysadmin-bin] Notify whenever a new key is registered successfully



commit dfac0c0f53ace951d45dcbd25db2ffac07b4aff6
Author: Andrea Veri <averi redhat com>
Date:   Mon Oct 16 19:24:46 2017 +0200

    Notify whenever a new key is registered successfully

 gitlab/gitlab.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gitlab/gitlab.py b/gitlab/gitlab.py
index eccdcc8..9b87aab 100755
--- a/gitlab/gitlab.py
+++ b/gitlab/gitlab.py
@@ -62,8 +62,10 @@ class Gitlab:
 
         try:
             response = urllib2.urlopen(req)
+
+            print 'Key for username with id %i has been added' % (user_id)
         except urllib2.HTTPError:
-            print 'Key for username with id %i is registered already' % (user_id)
+            pass
 
     def list_group_members(self, group, members=[]):
         import urllib2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]