~harlowja/cloud-init/cloud-init-net-refactor

« back to all changes in this revision

Viewing changes to cloudinit/config/cc_ssh.py

Enable flake8 and fix a large amount of reported issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        for f in glob.glob(key_pth):
58
58
            try:
59
59
                util.del_file(f)
60
 
            except:
 
60
            except Exception:
61
61
                util.logexc(log, "Failed deleting key file %s", f)
62
62
 
63
63
    if "ssh_keys" in cfg:
78
78
                with util.SeLinuxGuard("/etc/ssh", recursive=True):
79
79
                    util.subp(cmd, capture=False)
80
80
                log.debug("Generated a key for %s from %s", pair[0], pair[1])
81
 
            except:
 
81
            except Exception:
82
82
                util.logexc(log, "Failed generated a key for %s from %s",
83
83
                            pair[0], pair[1])
84
84
    else:
122
122
            keys.extend(cfgkeys)
123
123
 
124
124
        apply_credentials(keys, user, disable_root, disable_root_opts)
125
 
    except:
 
125
    except Exception:
126
126
        util.logexc(log, "Applying ssh credentials failed!")
127
127
 
128
128