From c62cb3af59abc464380011c106b31879181e7c45 Mon Sep 17 00:00:00 2001 From: Andrew Kutz <101085+akutz@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:18:56 -0500 Subject: Update inconsistent indentation (#962) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch updates some indentation in a comment that prevented an attempt to run the Black formatter (https://github.com/psf/black) against the cloud-init codebase: $ find cloudinit -name '*.py' -type f | xargs black -l 79 --check ... Oh no! 💥 💔 💥 262 files would be reformatted, 19 files would be left unchanged, 1 file would fail to reformat. The one file that fails to format is cloudinit/net/__init__.py. With this fix in place, the black command can successfully parse the file into AST and back again: $ black -l 79 --check cloudinit/net/__init__.py would reformat cloudinit/net/__init__.py Oh no! 💥 💔 💥 1 file would be reformatted. Normally this patch would be part of such an overall effort, but since this is the only location that interrupted running the black command, this author felt it was worth addressing this discrepancy sooner than later in the case there is subsequent desire to use a standard format tool such as black. --- cloudinit/net/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index b827d41a..655558a1 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -313,11 +313,11 @@ def is_netfail_standby(devname, driver=None): def is_renamed(devname): """ /* interface name assignment types (sysfs name_assign_type attribute) */ - #define NET_NAME_UNKNOWN 0 /* unknown origin (not exposed to user) */ - #define NET_NAME_ENUM 1 /* enumerated by kernel */ - #define NET_NAME_PREDICTABLE 2 /* predictably named by the kernel */ - #define NET_NAME_USER 3 /* provided by user-space */ - #define NET_NAME_RENAMED 4 /* renamed by user-space */ + #define NET_NAME_UNKNOWN 0 /* unknown origin (not exposed to user) */ + #define NET_NAME_ENUM 1 /* enumerated by kernel */ + #define NET_NAME_PREDICTABLE 2 /* predictably named by the kernel */ + #define NET_NAME_USER 3 /* provided by user-space */ + #define NET_NAME_RENAMED 4 /* renamed by user-space */ """ name_assign_type = read_sys_net_safe(devname, 'name_assign_type') if name_assign_type and name_assign_type in ['3', '4']: -- cgit v1.2.3