summaryrefslogtreecommitdiff
path: root/cloudinit/net/compat.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-06-07 10:59:27 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-06-07 10:59:27 -0700
commit6d0e6068f2692fd34c3c5cc93af7ec8ef5be4711 (patch)
tree40742ac517bd6f9b56724ef39fbe89d54ffbfc9c /cloudinit/net/compat.py
parent600ce494084368c511848c00fff7220255b14e6b (diff)
downloadvyos-cloud-init-6d0e6068f2692fd34c3c5cc93af7ec8ef5be4711.tar.gz
vyos-cloud-init-6d0e6068f2692fd34c3c5cc93af7ec8ef5be4711.zip
For now just remove compat.py module
Let's reduce the size of this change for now.
Diffstat (limited to 'cloudinit/net/compat.py')
-rw-r--r--cloudinit/net/compat.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/cloudinit/net/compat.py b/cloudinit/net/compat.py
deleted file mode 100644
index 8bf92ef5..00000000
--- a/cloudinit/net/compat.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Curtin is free software: you can redistribute it and/or modify it under
-# the terms of the GNU Affero General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# Curtin is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
-# more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Curtin. If not, see <http://www.gnu.org/licenses/>.
-
-# Mini six like module (so that this code can be more easily extracted).
-
-import sys
-
-PY26 = sys.version_info[0:2] == (2, 6)
-PY27 = sys.version_info[0:2] == (2, 7)
-PY2 = PY26 or PY27
-PY3 = sys.version_info[0:2] >= (3, 0)
-
-if PY3:
- text_type = str
- binary_type = bytes
- string_types = (text_type, text_type)
- import io
- StringIO = io.StringIO
-else:
- text_type = unicode
- binary_type = bytes
- string_types = (binary_type, text_type)
- from StringIO import StringIO # noqa
-
-
-# Taken from six (remove when we can actually directly use six)
-
-def add_metaclass(metaclass):
- """Class decorator for creating a class with a metaclass."""
- def wrapper(cls):
- orig_vars = cls.__dict__.copy()
- slots = orig_vars.get('__slots__')
- if slots is not None:
- if isinstance(slots, str):
- slots = [slots]
- for slots_var in slots:
- orig_vars.pop(slots_var)
- orig_vars.pop('__dict__', None)
- orig_vars.pop('__weakref__', None)
- return metaclass(cls.__name__, cls.__bases__, orig_vars)
- return wrapper