Commit 10275229 authored by Vincent Le gallic's avatar Vincent Le gallic

Dans la série suppression des liens symboliques : /usr/scripts/lib devient /usr/scripts/cranslib

 * Comme ça c'est plus clair que c'est un truc custom crans
 * Le lien symbolique /usr/scripts/gestion/crans/ est retiré. D'autres suivront.
parent c57795f2
#! /usr/bin/env python
import re, commands
import crans.utils.logs
log = crans.utils.logs.getFileLogger('autologout')
import cranslib.utils.logs
log = cranslib.utils.logs.getFileLogger('autologout')
# pour chaque ligne du w
for w in commands.getoutput("w -h").split('\n') :
......
......@@ -32,11 +32,12 @@ __version__ = '1'
import sys, syslog, os.path
sys.path.append('/usr/scripts/gestion')
sys.path.append('/usr/scripts/')
import config.impression
import cout
from crans.utils import QuoteForPOSIX as escapeForShell
import crans.utils.logs
log = crans.utils.logs.getFileLogger('impression')
from cranslib.utils import QuoteForPOSIX as escapeForShell
import cranslib.utils.logs
log = cranslib.utils.logs.getFileLogger('impression')
# Début : Ajout log pour réestimer les coûts
import time
import hptools
......
......@@ -4,10 +4,10 @@ import re
import commands
import sys
sys.path.append('/usr/scripts/')
import lib.utils.logs
import cranslib.utils.logs
import logging
LOGGER = logging.getLogger("crans.autologout")
LOGGER.addHandler(lib.utils.logs.CransFileHandler("autologout"))
LOGGER.addHandler(cranslib.utils.logs.CransFileHandler("autologout"))
LOGGER.setLevel(logging.WARNING)
def run_autologout():
......
......@@ -3,8 +3,7 @@ import logging
import sys
sys.path.append('/usr/scripts/')
from lib.utils.logs import getFileLogger
#LOGGER = logging.getLogger("crans.scripts.test")
from cranslib.utils.logs import getFileLogger
LOGGER = getFileLogger("helloworld")
LOGGER.setLevel(logging.INFO)
LOGGER.addHandler(logging.StreamHandler())
......
# -*- coding:utf-8 -*-
import sys
sys.path.append('/usr/scripts/')
from lib import *
# En vrai, ce truc est deprecated
import lib.deprecated
lib.deprecated.module()
......@@ -25,11 +25,12 @@
# PURPOSE.
import sys
sys.path.append('/usr/scripts/')
sys.path.append('/usr/scripts/gestion')
sys.path.append('/usr/scripts/lc_ldap')
import crans.deprecated
crans.deprecated.module()
import cranslib.deprecated
cranslib.deprecated.module()
import syslog
import pwd
......
......@@ -17,6 +17,7 @@
import sys, os, commands, smtplib, tempfile, getopt
os.umask(0117)
sys.path.append('/usr/scripts/')
sys.path.append('/usr/scripts/gestion')
from hptools import hpswitch, sw_chbre
from ldap_crans import crans_ldap, BorneWifi
......@@ -26,7 +27,7 @@ from gen_confs import *
import datetime
import config
import re
from crans.deprecated import deprecated
from cranslib.deprecated import deprecated
capture_model = re.compile(r'\((.*)\)')
headers_by_model = {
......
......@@ -39,7 +39,7 @@ import shutil
import syslog
import stat
sys.path.append('/usr/scripts/')
from lib.utils import QuoteForPOSIX as escapeForShell
from cranslib.utils import QuoteForPOSIX as escapeForShell
def __init__():
pass
......
......@@ -33,7 +33,7 @@ import commands
import string
import random
sys.path.append("/usr/scripts/")
import lib.utils.files
import cranslib.utils.files
# #############################################################
# CONSTANTES
# #############################################################
......@@ -132,7 +132,7 @@ def list_code():
files = os.listdir(CODES_DIR)
code_list = []
for aCode in files:
age = lib.utils.files.ageOfFile(os.path.join(CODES_DIR, aCode ) )
age = cranslib.utils.files.ageOfFile(os.path.join(CODES_DIR, aCode ) )
content = read_code_file(aCode)
code_list.append((aCode, age, content ) )
return code_list
......@@ -161,5 +161,5 @@ def menage():
for aFile in fileList:
aFilePath = os.path.join(CODES_DIR, aFile)
if os.path.isfile(aFilePath):
if lib.utils.files.fileIsOlderThan(aFilePath, days=1):
if cranslib.utils.files.fileIsOlderThan(aFilePath, days=1):
os.remove(aFilePath)
......@@ -35,7 +35,7 @@ sys.path.append('/usr/scripts/gestion')
from config import impression as config_impression
from commands import getstatusoutput
sys.path.append('/usr/scripts/')
from lib.utils import logs
from cranslib.utils import logs
from subprocess import Popen, PIPE
# ######################################################## #
......
......@@ -30,7 +30,7 @@ def log(x):
syslog.syslog(x)
syslog.closelog()
from lib.utils import exceptions
from cranslib.utils import exceptions
import locale
locale.setlocale(locale.LC_TIME, 'fr_FR.utf8')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment