Fix imports and change calculate2.env to calculate3.env.

master3.3
Mike Hiretsky 13 years ago
parent 5c75d74894
commit e37185eb59

@ -20,7 +20,7 @@ import textwrap
import optparse
from utils.text import _toUNICODE
from cl_lang import setLocalDomain
from cl_lang import setLocalTranslate
setLocalTranslate('cl_lib',sys.modules[__name__],optparse)
def check_choice_regignore(option, opt, value):

@ -42,9 +42,9 @@ class Data:
# aliases and path to ini files
cl_env_data = {'hide':True,
'value':[('default', '/etc/calculate/calculate2.env'),
('local', '/var/calculate/calculate2.env'),
('remote', '/var/calculate/remote/calculate2.env')]}
'value':[('default', '/etc/calculate/calculate3.env'),
('local', '/var/calculate/calculate3.env'),
('remote', '/var/calculate/remote/calculate3.env')]}
# path aliases to ini files (from cl_env_data)
cl_env_location = {'hide':True}

@ -41,7 +41,7 @@ def getUUIDDict(revers=False):
blkidProcess)))))
from files import (getProgPath,pathJoin,listDirectory,
checkUtils)
checkUtils,readFile)
def detectDeviceForPartition(dev):
"""Detect parent device for partition by udev and return property"""

@ -23,7 +23,6 @@ from shutil import copytree, rmtree
from calculate.lib import cl_overriding
import re
import sys
from common import getpathenv
try:
from magic import open as type_file, MAGIC_NONE as MAGIC_NONE
@ -547,11 +546,13 @@ def readFile(filename):
pass
return ""
import common
def getProgPath(progname):
"""Get full path of program or False"""
baseprogname = path.basename(progname)
env = {"LANG":"C"}
env.update(os.environ.items() + [("PATH",getpathenv())] +\
env.update(os.environ.items() + [("PATH",common.getpathenv())] +\
env.items())
res = runOsCommand("which %s"%baseprogname,env_dict=env)
if path.isabs(progname) and path.exists(progname):
@ -632,6 +633,8 @@ class SingletonParam(type):
cls.instance[keyarg] = super(SingletonParam, cls).__call__(*args, **kw)
return cls.instance[keyarg]
import device
class FStab(object):
"""Data reader for fstab"""
__metaclass__ = SingletonParam
@ -654,7 +657,7 @@ class FStab(object):
open(self.fstab_file,'r').read().split('\n')))
for data in self.cache:
convertDev = lambda x: path.realpath(x) if x.startswith('/') else x
data[0] = getUdevDeviceInfo(
data[0] = device.getUdevDeviceInfo(
name=convertDev(self.dictUUID.get(data[0],data[0]))
).get('DEVNAME','')
data[1] = data[1] if data[2] != "swap" else "swap"

Loading…
Cancel
Save