diff options
| author | Chad Smith <chad.smith@canonical.com> | 2018-02-02 11:11:36 -0700 |
|---|---|---|
| committer | Chad Smith <chad.smith@canonical.com> | 2018-02-02 11:11:36 -0700 |
| commit | 78013bc65030421699b5feb66bc8b7a205abfbc0 (patch) | |
| tree | 2ebf7111129f4aaf8a833ba6d226d4513ed59388 /cloudinit/net/__init__.py | |
| parent | 192261fe38a32edbd1f605ba25bbb6f4822a0720 (diff) | |
| parent | f7deaf15acf382d62554e2b1d70daa9a9109d542 (diff) | |
| download | vyos-cloud-init-78013bc65030421699b5feb66bc8b7a205abfbc0.tar.gz vyos-cloud-init-78013bc65030421699b5feb66bc8b7a205abfbc0.zip | |
merge from master at 17.2-30-gf7deaf15
Diffstat (limited to 'cloudinit/net/__init__.py')
| -rw-r--r-- | cloudinit/net/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index a1b0db10..c015e793 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -18,7 +18,7 @@ SYS_CLASS_NET = "/sys/class/net/" DEFAULT_PRIMARY_INTERFACE = 'eth0' -def _natural_sort_key(s, _nsre=re.compile('([0-9]+)')): +def natural_sort_key(s, _nsre=re.compile('([0-9]+)')): """Sorting for Humans: natural sort order. Can be use as the key to sort functions. This will sort ['eth0', 'ens3', 'ens10', 'ens12', 'ens8', 'ens0'] as @@ -224,7 +224,7 @@ def find_fallback_nic(blacklist_drivers=None): # if eth0 exists use it above anything else, otherwise get the interface # that we can read 'first' (using the sorted defintion of first). - names = list(sorted(potential_interfaces, key=_natural_sort_key)) + names = list(sorted(potential_interfaces, key=natural_sort_key)) if DEFAULT_PRIMARY_INTERFACE in names: names.remove(DEFAULT_PRIMARY_INTERFACE) names.insert(0, DEFAULT_PRIMARY_INTERFACE) |
