Enable pycodestyle

Apply fix-ups and run pycodestyle during CI testing.

Change-Id: I1005495b11e228abdc8d40a51dbf81c4a6e6c92c
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/obmc/dbuslib/bindings.py b/obmc/dbuslib/bindings.py
index 8a04447..acc8792 100644
--- a/obmc/dbuslib/bindings.py
+++ b/obmc/dbuslib/bindings.py
@@ -56,7 +56,7 @@
         try:
             v = d[property_name]
             return v
-        except:
+        except Exception:
             raise dbus.exceptions.DBusException(
                 "Unknown property: '{}'".format(property_name),
                 name="org.freedesktop.DBus.Error.UnknownProperty")
@@ -68,7 +68,7 @@
         try:
             d = self.properties[interface_name]
             return d
-        except:
+        except Exception:
             raise dbus.exceptions.DBusException(
                 "Unknown interface: '{}'".format(interface_name),
                 name="org.freedesktop.DBus.Error.UnknownInterface")
@@ -91,7 +91,7 @@
                     self.PropertiesChanged(
                         interface_name, {property_name: new_value}, [])
 
-        except:
+        except Exception:
             self.properties[interface_name][property_name] = new_value
             if self._export:
                 self.PropertiesChanged(
@@ -112,7 +112,7 @@
                     self.properties[interface_name][property_name] = new_value
                     value_changed = True
 
-            except:
+            except Exception:
                 self.properties[interface_name][property_name] = new_value
                 value_changed = True
         if (value_changed is True and self._export):
diff --git a/obmc/dbuslib/propertycacher.py b/obmc/dbuslib/propertycacher.py
index 875b164..6086bc6 100644
--- a/obmc/dbuslib/propertycacher.py
+++ b/obmc/dbuslib/propertycacher.py
@@ -14,6 +14,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 
+import json
 import os
 # TODO: openbmc/openbmc#2994 remove python 2 support
 import sys
@@ -21,19 +22,18 @@
     import cPickle as pickle
 else:
     import pickle
-import json
 
 CACHE_PATH = '/var/cache/obmc/'
 
 
 def getCacheFilename(obj_path, iface_name):
     name = obj_path.replace('/', '.')
-    filename = CACHE_PATH+name[1:]+"@"+iface_name+".props"
+    filename = CACHE_PATH + name[1:] + "@" + iface_name + ".props"
     return filename
 
 
 def save(obj_path, iface_name, properties):
-    print("Caching: "+obj_path)
+    print("Caching: "+ obj_path)
     filename = getCacheFilename(obj_path, iface_name)
     parent = os.path.dirname(filename)
     try:
@@ -41,23 +41,23 @@
             os.makedirs(parent)
         with open(filename, 'wb') as output:
             try:
-                ## use json module to convert dbus datatypes
+                # use json module to convert dbus datatypes
                 props = json.dumps(properties[iface_name])
                 prop_obj = json.loads(props)
                 pickle.dump(prop_obj, output)
             except Exception as e:
-                print("ERROR: "+str(e))
-    except:
-        print("ERROR opening cache file: "+filename)
+                print("ERROR: " + str(e))
+    except Exception:
+        print("ERROR opening cache file: " + filename)
 
 
 def load(obj_path, iface_name, properties):
-    ## overlay with pickled data
+    # overlay with pickled data
     filename = getCacheFilename(obj_path, iface_name)
     if (os.path.isfile(filename)):
         if iface_name in properties:
             properties[iface_name] = {}
-        print("Loading from cache: "+filename)
+        print("Loading from cache: " + filename)
         try:
             p = open(filename, 'rb')
             data = pickle.load(p)