summaryrefslogtreecommitdiff
path: root/cloudinit/user_data.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 09:44:47 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 09:44:47 -0700
commita4454ec81a44142db0c51ceb76b979ace4b1176e (patch)
treebf98da7158b2d7729c7caf64bad41e2ebc2b34db /cloudinit/user_data.py
parent1e330c73a24385133ae1d321451c61f16fee766b (diff)
downloadvyos-cloud-init-a4454ec81a44142db0c51ceb76b979ace4b1176e.tar.gz
vyos-cloud-init-a4454ec81a44142db0c51ceb76b979ace4b1176e.zip
For the different base classes, ensure we are using the 'abc' module + appropriate annotations + metaclasses.
Diffstat (limited to 'cloudinit/user_data.py')
-rw-r--r--cloudinit/user_data.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py
index f64a1707..28c9f2ce 100644
--- a/cloudinit/user_data.py
+++ b/cloudinit/user_data.py
@@ -20,7 +20,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+import abc
import os
import email
@@ -233,6 +233,9 @@ class UserDataProcessor(object):
class PartHandler(object):
+
+ __metaclass__ = abc.ABCMeta
+
def __init__(self, frequency, version=2):
self.handler_version = version
self.frequency = frequency
@@ -240,12 +243,14 @@ class PartHandler(object):
def __repr__(self):
return "%s: [%s]" % (util.obj_name(self), self.list_types())
+ @abc.abstractmethod
def list_types(self):
raise NotImplementedError()
def handle_part(self, data, ctype, filename, payload, frequency):
return self._handle_part(data, ctype, filename, payload, frequency)
+ @abc.abstractmethod
def _handle_part(self, data, ctype, filename, payload, frequency):
raise NotImplementedError()