From c2631bd8e37648c5f1b6d337914de9e1ad93c4c6 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Mon, 27 Jun 2011 14:51:54 -0400 Subject: [PATCH] remove unused 'constants' module --- src/pylorax/__init__.py | 5 ---- src/pylorax/constants.py | 60 ---------------------------------------- 2 files changed, 65 deletions(-) delete mode 100644 src/pylorax/constants.py diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index f1af4e6c..5bafd8a9 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -41,7 +41,6 @@ import yum import ltmpl import imgutils -import constants from sysutils import * from treebuilder import RuntimeBuilder, TreeBuilder @@ -154,10 +153,6 @@ class Lorax(BaseLoraxClass): logger.critical("no root privileges") sys.exit(1) - # do we have all lorax required commands? - self.lcmds = constants.LoraxRequiredCommands() - # TODO: actually check for required commands (runcmd etc) - # do we have a proper yum base object? logger.info("checking yum base object") if not isinstance(ybo, yum.YumBase): diff --git a/src/pylorax/constants.py b/src/pylorax/constants.py deleted file mode 100644 index 0c72dd7e..00000000 --- a/src/pylorax/constants.py +++ /dev/null @@ -1,60 +0,0 @@ -# -# constants.py -# -# Copyright (C) 2009 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Red Hat Author(s): Martin Gracik -# - -import logging -logger = logging.getLogger("pylorax") - -import os -from sysutils import joinpaths - - -class LoraxRequiredCommands(dict): - - def __init__(self): - dict.__init__(self) - - self.__path = os.environ["PATH"].split(":") - logger.debug("PATH: {0}".format(self.__path)) - - self["AWK"] = "awk" - self["BUILD_LOCALE_ARCHIVE"] = "build-locale-archive" - self["CPIO"] = "cpio" - self["DEPMOD"] = "depmod" - self["DMSETUP"] = "dmsetup" - self["FIND"] = "find" - self["GCONFTOOL"] = "gconftool-2" - self["IMPLANTISOMD5"] = "implantisomd5" - self["ISOHYBRID"] = "isohybrid" - self["LDCONFIG"] = "ldconfig" - self["LOCALEDEF"] = "localedef" - self["LOSETUP"] = "losetup" - self["MKDOSFS"] = "mkdosfs" - self["MKISOFS"] = "mkisofs" - self["MODINFO"] = "modinfo" - self["MOUNT"] = "mount" - self["PARTED"] = "parted" - self["SSHKEYGEN"] = "ssh-keygen" - self["UMOUNT"] = "umount" - - def __getattr__(self, attr): - return self[attr] - -FS_OVERHEAD = 512