summaryrefslogtreecommitdiff
path: root/obsapi
diff options
context:
space:
mode:
authorScott Bahling <sbahling@suse.de>2018-07-18 17:22:00 +0200
committerScott Bahling <sbahling@suse.de>2018-07-18 17:22:00 +0200
commit19264fdace6eed4fe600948741d21a4b9f947423 (patch)
treec150ad65f577468358a0c5a482072b94023529d9 /obsapi
parentda1e9fd7c1236b17590946aff5a7ae638d50c6df (diff)
downloadobsapi-19264fdace6eed4fe600948741d21a4b9f947423.tar.gz
obsapi-19264fdace6eed4fe600948741d21a4b9f947423.tar.xz
obsapi-19264fdace6eed4fe600948741d21a4b9f947423.zip
Make flake8 happy
Add dummy logger for now
Diffstat (limited to 'obsapi')
-rw-r--r--obsapi/buildapi.py1
-rw-r--r--obsapi/httpapi.py6
-rw-r--r--obsapi/logger.py30
3 files changed, 35 insertions, 2 deletions
diff --git a/obsapi/buildapi.py b/obsapi/buildapi.py
index 40054b1..eceea4d 100644
--- a/obsapi/buildapi.py
+++ b/obsapi/buildapi.py
@@ -2,6 +2,7 @@
#
from obsapi.httpapi import ObsHttpApi
+
class ObsBuildApi(ObsHttpApi):
rootapi = '/build/'
diff --git a/obsapi/httpapi.py b/obsapi/httpapi.py
index 8ca49e8..cfdbfde 100644
--- a/obsapi/httpapi.py
+++ b/obsapi/httpapi.py
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
#
import requests
+from log import logger
from requests.auth import HTTPBasicAuth
from null import Null
try:
import osc.conf as osc_conf
-except:
+except Exception as e:
osc_conf = None
DEFAULTAPIURL = 'https://api.opensuse.org'
@@ -34,7 +35,8 @@ class ObsHttpApi(object):
try:
osc_conf.get_config()
conf = osc_conf.get_apiurl_api_host_options(self.apiurl)
- except:
+ except Exception as e:
+ logger.debug(e)
pass
user = conf.get('user', None)
diff --git a/obsapi/logger.py b/obsapi/logger.py
new file mode 100644
index 0000000..4831ee0
--- /dev/null
+++ b/obsapi/logger.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+"""
+ obsapi: log module
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+
+ This module contains the Logging class
+
+
+ :copyright: Copyright (c) 2018 Scott Bahling, SUSE Linux GmbH
+ :license: GPL-2.0, see COPYING for details
+"""
+
+class Logger(object):
+
+ def __init__(self):
+ self.logger = None
+
+ def info(msg):
+ pass
+
+ def warning(msg):
+ pass
+
+ def debug(msg):
+ pass
+
+ def error(msg):
+ pass
+
+logger = Logger()