diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-01-21 17:15:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 17:15:30 -0500 |
commit | 8c4fd886931abcf2cc8627a47463907d655b35c3 (patch) | |
tree | 5abcf1140d58c0498da01fa746d5581558423d2c /cloudinit/handlers/__init__.py | |
parent | 0562ca696fe1a36b6c3b2fb576068e05033f6f3f (diff) | |
download | vyos-cloud-init-8c4fd886931abcf2cc8627a47463907d655b35c3.tar.gz vyos-cloud-init-8c4fd886931abcf2cc8627a47463907d655b35c3.zip |
Start removing dependency on six (#178)
* url_helper: drop six
* url_helper: sort imports
* log: drop six
* log: sort imports
* handlers/__init__: drop six
* handlers/__init__: sort imports
* user_data: drop six
* user_data: sort imports
* sources/__init__: drop six
* sources/__init__: sort imports
* DataSourceOVF: drop six
* DataSourceOVF: sort imports
* sources/helpers/openstack: drop six
* sources/helpers/openstack: sort imports
* mergers/m_str: drop six
This also allowed simplification of the logic, as we will never
encounter a non-string text type.
* type_utils: drop six
* mergers/m_dict: drop six
* mergers/m_list: drop six
* cmd/query: drop six
* mergers/__init__: drop six
* net/cmdline: drop six
* reporting/handlers: drop six
* reporting/handlers: sort imports
Diffstat (limited to 'cloudinit/handlers/__init__.py')
-rw-r--r-- | cloudinit/handlers/__init__.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py index 0db75af9..a409ff8a 100644 --- a/cloudinit/handlers/__init__.py +++ b/cloudinit/handlers/__init__.py @@ -10,14 +10,12 @@ import abc import os -import six - -from cloudinit.settings import (PER_ALWAYS, PER_INSTANCE, FREQUENCIES) from cloudinit import importer from cloudinit import log as logging from cloudinit import type_utils from cloudinit import util +from cloudinit.settings import (PER_ALWAYS, PER_INSTANCE, FREQUENCIES) LOG = logging.getLogger(__name__) @@ -60,8 +58,7 @@ INCLUSION_SRCH = sorted(list(INCLUSION_TYPES_MAP.keys()), key=(lambda e: 0 - len(e))) -@six.add_metaclass(abc.ABCMeta) -class Handler(object): +class Handler(metaclass=abc.ABCMeta): def __init__(self, frequency, version=2): self.handler_version = version @@ -159,7 +156,7 @@ def _extract_first_or_bytes(blob, size): # Extract the first line or upto X symbols for text objects # Extract first X bytes for binary objects try: - if isinstance(blob, six.string_types): + if isinstance(blob, str): start = blob.split("\n", 1)[0] else: # We want to avoid decoding the whole blob (it might be huge) |