Add {enable, disable}_guestfs methods in image cls
[snf-image-creator] / image_creator / os_type / ubuntu.py
index c0ed913..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.
 
+"""This module hosts OS-specific code for Ubuntu Linux"""
+
 from image_creator.os_type.linux import Linux
 
 
 class Ubuntu(Linux):
     """OS class for Ubuntu Linux variants"""
-    def __init__(self, rootdev, ghandler, output):
-        super(Ubuntu, self).__init__(rootdev, ghandler, output)
 
-        apps = self.g.inspect_list_applications(self.root)
+    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':
                 self.meta['OS'] = 'kubuntu'