diff options
author | Joshua Powers <josh.powers@canonical.com> | 2017-04-06 11:14:29 -0700 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2017-04-21 10:14:47 -0400 |
commit | 5afe4cd0797a12d07ea19b9715b720d47bdea401 (patch) | |
tree | 8be9e7b623002b1fd60fb21b95696ab6b67ca497 /cloudinit/distros/ug_util.py | |
parent | 33816e96d8981918f734dab3ee1a967bce85451a (diff) | |
download | vyos-cloud-init-5afe4cd0797a12d07ea19b9715b720d47bdea401.tar.gz vyos-cloud-init-5afe4cd0797a12d07ea19b9715b720d47bdea401.zip |
pylint: fix all logging warnings
This will change all instances of LOG.warn to LOG.warning as warn
is now a deprecated method. It will also make sure any logging
uses lazy logging by passing string format arguments as function
parameters.
Diffstat (limited to 'cloudinit/distros/ug_util.py')
-rwxr-xr-x | cloudinit/distros/ug_util.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cloudinit/distros/ug_util.py b/cloudinit/distros/ug_util.py index 53a0eafb..9378dd78 100755 --- a/cloudinit/distros/ug_util.py +++ b/cloudinit/distros/ug_util.py @@ -214,8 +214,8 @@ def normalize_users_groups(cfg, distro): 'name': old_user, } if not isinstance(old_user, dict): - LOG.warn(("Format for 'user' key must be a string or " - "dictionary and not %s"), type_utils.obj_name(old_user)) + LOG.warning(("Format for 'user' key must be a string or dictionary" + " and not %s"), type_utils.obj_name(old_user)) old_user = {} # If no old user format, then assume the distro @@ -227,9 +227,9 @@ def normalize_users_groups(cfg, distro): try: distro_user_config = distro.get_default_user() except NotImplementedError: - LOG.warn(("Distro has not implemented default user " - "access. No distribution provided default user" - " will be normalized.")) + LOG.warning(("Distro has not implemented default user " + "access. No distribution provided default user" + " will be normalized.")) # Merge the old user (which may just be an empty dict when not # present with the distro provided default user configuration so @@ -239,9 +239,9 @@ def normalize_users_groups(cfg, distro): base_users = cfg.get('users', []) if not isinstance(base_users, (list, dict) + six.string_types): - LOG.warn(("Format for 'users' key must be a comma separated string" - " or a dictionary or a list and not %s"), - type_utils.obj_name(base_users)) + LOG.warning(("Format for 'users' key must be a comma separated string" + " or a dictionary or a list and not %s"), + type_utils.obj_name(base_users)) base_users = [] if old_user: |