~cloud-init-dev/cloud-init/trunk

« back to all changes in this revision

Viewing changes to cloudinit/handlers/__init__.py

Enable flake8 and fix a large amount of reported issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
                        key=(lambda e: 0 - len(e)))
72
72
 
73
73
 
 
74
@six.add_metaclass(abc.ABCMeta)
74
75
class Handler(object):
75
 
    __metaclass__ = abc.ABCMeta
76
76
 
77
77
    def __init__(self, frequency, version=2):
78
78
        self.handler_version = version
118
118
            mod.handle_part(data, content_type, filename, payload)
119
119
        else:
120
120
            raise ValueError("Unknown module version %s" % (mod_ver))
121
 
    except:
 
121
    except Exception:
122
122
        util.logexc(LOG, "Failed calling handler %s (%s, %s, %s) with "
123
123
                    "frequency %s", mod, content_type, filename, mod_ver,
124
124
                    frequency)
157
157
        # register if it fails starting.
158
158
        handlers.register(mod, initialized=True)
159
159
        pdata['handlercount'] = curcount + 1
160
 
    except:
 
160
    except Exception:
161
161
        util.logexc(LOG, "Failed at registering python file: %s (part "
162
162
                    "handler %s)", modfname, curcount)
163
163