Add {enable, disable}_guestfs methods in image cls
[snf-image-creator] / image_creator / os_type / ubuntu.py
index 4dec1e8..0647c6f 100644 (file)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
 # Copyright 2012 GRNET S.A. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from image_creator.os_type.linux import Linux, exclude_task
+"""This module hosts OS-specific code for Ubuntu Linux"""
+
+from image_creator.os_type.linux import Linux
 
 
 class Ubuntu(Linux):
-    def get_metadata(self):
-        meta = super(Ubuntu, self).get_metadata()
-        apps = self.g.inspect_list_applications(self.root)
+    """OS class for Ubuntu Linux variants"""
+
+    def _do_collect_metadata(self):
+        """Collect metadata about the OS"""
+
+        super(Ubuntu, self)._do_collect_metadata()
+        apps = self.image.g.inspect_list_applications(self.root)
         for app in apps:
             if app['app_name'] == 'kubuntu-desktop':
-                meta['OS'] = 'kubuntu'
-                meta['DESCRIPTION'] = \
-                            meta['DESCRIPTION'].replace('Ubuntu', 'Kubuntu')
+                self.meta['OS'] = 'kubuntu'
+                descr = self.meta['DESCRIPTION'].replace('Ubuntu', 'Kubuntu')
+                self.meta['DESCRIPTION'] = descr
                 break
-        return meta
 
 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :