Skip to content

Instantly share code, notes, and snippets.

@kjmkznr
Created December 20, 2014 03:29
Show Gist options
  • Save kjmkznr/69ba4e035d514e2fdc72 to your computer and use it in GitHub Desktop.
Save kjmkznr/69ba4e035d514e2fdc72 to your computer and use it in GitHub Desktop.
diff --git a/gcimagebundle/gcimagebundlelib/platform_factory.py b/gcimagebundle/gcimagebundlelib/platform_factory.py
index da63f0e..c967813 100644
--- a/gcimagebundle/gcimagebundlelib/platform_factory.py
+++ b/gcimagebundle/gcimagebundlelib/platform_factory.py
@@ -25,6 +25,7 @@ from gcimagebundlelib import opensuse
from gcimagebundlelib import rhel
from gcimagebundlelib import sle
from gcimagebundlelib import ubuntu
+from gcimagebundlelib import gentoo
class UnknownPlatformException(Exception):
@@ -46,6 +47,7 @@ class PlatformFactory(object):
self.Register('Red Hat Enterprise Linux', rhel.RHEL)
self.Register('SUSE Linux Enterprise', sle.SLE)
self.Register('Ubuntu', ubuntu.Ubuntu)
+ self.Register('Gentoo', gentoo.Gentoo)
def Register(self, name, klass):
self.__registry[name] = klass
"""Gentoo specific platform info."""
import os
import platform
from gcimagebundlelib import linux
class Gentoo(linux.LinuxPlatform):
"""Gentoo specific information."""
@staticmethod
def IsThisPlatform(root='/'):
release_file = root + '/etc/gentoo-release'
if os.path.exists(release_file):
return True
return False
def __init__(self):
super(Gentoo, self).__init__()
def GetPreferredFilesystemType(self):
return 'ext4'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment