summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kutz <101085+akutz@users.noreply.github.com>2021-08-10 13:18:56 -0500
committerGitHub <noreply@github.com>2021-08-10 13:18:56 -0500
commitc62cb3af59abc464380011c106b31879181e7c45 (patch)
treeea687620f82db571b4f0351bb5ab71622fb89830
parent9893dfcd2f0be92197d707236cbd44cb7452364d (diff)
downloadvyos-cloud-init-c62cb3af59abc464380011c106b31879181e7c45.tar.gz
vyos-cloud-init-c62cb3af59abc464380011c106b31879181e7c45.zip
Update inconsistent indentation (#962)
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.
-rw-r--r--cloudinit/net/__init__.py10
1 files 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']: