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.
This commit is contained in:
parent
c57795f23b
commit
10275229a1
35 changed files with 20 additions and 29 deletions
|
@ -1,8 +1,8 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
import re, commands
|
import re, commands
|
||||||
import crans.utils.logs
|
import cranslib.utils.logs
|
||||||
log = crans.utils.logs.getFileLogger('autologout')
|
log = cranslib.utils.logs.getFileLogger('autologout')
|
||||||
|
|
||||||
# pour chaque ligne du w
|
# pour chaque ligne du w
|
||||||
for w in commands.getoutput("w -h").split('\n') :
|
for w in commands.getoutput("w -h").split('\n') :
|
||||||
|
|
|
@ -32,11 +32,12 @@ __version__ = '1'
|
||||||
|
|
||||||
import sys, syslog, os.path
|
import sys, syslog, os.path
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
import config.impression
|
import config.impression
|
||||||
import cout
|
import cout
|
||||||
from crans.utils import QuoteForPOSIX as escapeForShell
|
from cranslib.utils import QuoteForPOSIX as escapeForShell
|
||||||
import crans.utils.logs
|
import cranslib.utils.logs
|
||||||
log = crans.utils.logs.getFileLogger('impression')
|
log = cranslib.utils.logs.getFileLogger('impression')
|
||||||
# Début : Ajout log pour réestimer les coûts
|
# Début : Ajout log pour réestimer les coûts
|
||||||
import time
|
import time
|
||||||
import hptools
|
import hptools
|
||||||
|
|
|
@ -4,10 +4,10 @@ import re
|
||||||
import commands
|
import commands
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('/usr/scripts/')
|
sys.path.append('/usr/scripts/')
|
||||||
import lib.utils.logs
|
import cranslib.utils.logs
|
||||||
import logging
|
import logging
|
||||||
LOGGER = logging.getLogger("crans.autologout")
|
LOGGER = logging.getLogger("crans.autologout")
|
||||||
LOGGER.addHandler(lib.utils.logs.CransFileHandler("autologout"))
|
LOGGER.addHandler(cranslib.utils.logs.CransFileHandler("autologout"))
|
||||||
LOGGER.setLevel(logging.WARNING)
|
LOGGER.setLevel(logging.WARNING)
|
||||||
|
|
||||||
def run_autologout():
|
def run_autologout():
|
|
@ -3,8 +3,7 @@ import logging
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('/usr/scripts/')
|
sys.path.append('/usr/scripts/')
|
||||||
from lib.utils.logs import getFileLogger
|
from cranslib.utils.logs import getFileLogger
|
||||||
#LOGGER = logging.getLogger("crans.scripts.test")
|
|
||||||
LOGGER = getFileLogger("helloworld")
|
LOGGER = getFileLogger("helloworld")
|
||||||
LOGGER.setLevel(logging.INFO)
|
LOGGER.setLevel(logging.INFO)
|
||||||
LOGGER.addHandler(logging.StreamHandler())
|
LOGGER.addHandler(logging.StreamHandler())
|
|
@ -1,11 +0,0 @@
|
||||||
# -*- 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.
|
# PURPOSE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
sys.path.append('/usr/scripts/lc_ldap')
|
sys.path.append('/usr/scripts/lc_ldap')
|
||||||
|
|
||||||
import crans.deprecated
|
import cranslib.deprecated
|
||||||
crans.deprecated.module()
|
cranslib.deprecated.module()
|
||||||
|
|
||||||
import syslog
|
import syslog
|
||||||
import pwd
|
import pwd
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
import sys, os, commands, smtplib, tempfile, getopt
|
import sys, os, commands, smtplib, tempfile, getopt
|
||||||
os.umask(0117)
|
os.umask(0117)
|
||||||
|
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
from hptools import hpswitch, sw_chbre
|
from hptools import hpswitch, sw_chbre
|
||||||
from ldap_crans import crans_ldap, BorneWifi
|
from ldap_crans import crans_ldap, BorneWifi
|
||||||
|
@ -26,7 +27,7 @@ from gen_confs import *
|
||||||
import datetime
|
import datetime
|
||||||
import config
|
import config
|
||||||
import re
|
import re
|
||||||
from crans.deprecated import deprecated
|
from cranslib.deprecated import deprecated
|
||||||
|
|
||||||
capture_model = re.compile(r'\((.*)\)')
|
capture_model = re.compile(r'\((.*)\)')
|
||||||
headers_by_model = {
|
headers_by_model = {
|
||||||
|
|
|
@ -39,7 +39,7 @@ import shutil
|
||||||
import syslog
|
import syslog
|
||||||
import stat
|
import stat
|
||||||
sys.path.append('/usr/scripts/')
|
sys.path.append('/usr/scripts/')
|
||||||
from lib.utils import QuoteForPOSIX as escapeForShell
|
from cranslib.utils import QuoteForPOSIX as escapeForShell
|
||||||
def __init__():
|
def __init__():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import commands
|
||||||
import string
|
import string
|
||||||
import random
|
import random
|
||||||
sys.path.append("/usr/scripts/")
|
sys.path.append("/usr/scripts/")
|
||||||
import lib.utils.files
|
import cranslib.utils.files
|
||||||
# #############################################################
|
# #############################################################
|
||||||
# CONSTANTES
|
# CONSTANTES
|
||||||
# #############################################################
|
# #############################################################
|
||||||
|
@ -132,7 +132,7 @@ def list_code():
|
||||||
files = os.listdir(CODES_DIR)
|
files = os.listdir(CODES_DIR)
|
||||||
code_list = []
|
code_list = []
|
||||||
for aCode in files:
|
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)
|
content = read_code_file(aCode)
|
||||||
code_list.append((aCode, age, content ) )
|
code_list.append((aCode, age, content ) )
|
||||||
return code_list
|
return code_list
|
||||||
|
@ -161,5 +161,5 @@ def menage():
|
||||||
for aFile in fileList:
|
for aFile in fileList:
|
||||||
aFilePath = os.path.join(CODES_DIR, aFile)
|
aFilePath = os.path.join(CODES_DIR, aFile)
|
||||||
if os.path.isfile(aFilePath):
|
if os.path.isfile(aFilePath):
|
||||||
if lib.utils.files.fileIsOlderThan(aFilePath, days=1):
|
if cranslib.utils.files.fileIsOlderThan(aFilePath, days=1):
|
||||||
os.remove(aFilePath)
|
os.remove(aFilePath)
|
||||||
|
|
|
@ -35,7 +35,7 @@ sys.path.append('/usr/scripts/gestion')
|
||||||
from config import impression as config_impression
|
from config import impression as config_impression
|
||||||
from commands import getstatusoutput
|
from commands import getstatusoutput
|
||||||
sys.path.append('/usr/scripts/')
|
sys.path.append('/usr/scripts/')
|
||||||
from lib.utils import logs
|
from cranslib.utils import logs
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
# ######################################################## #
|
# ######################################################## #
|
||||||
|
|
|
@ -30,7 +30,7 @@ def log(x):
|
||||||
syslog.syslog(x)
|
syslog.syslog(x)
|
||||||
syslog.closelog()
|
syslog.closelog()
|
||||||
|
|
||||||
from lib.utils import exceptions
|
from cranslib.utils import exceptions
|
||||||
|
|
||||||
import locale
|
import locale
|
||||||
locale.setlocale(locale.LC_TIME, 'fr_FR.utf8')
|
locale.setlocale(locale.LC_TIME, 'fr_FR.utf8')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue