#!/usr/bin/env python

import os
import glob
import logging

class G:
    fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'

def scan_osts():
    fsname = None
    ostnames = []
    osts = glob.glob("/proc/fs/lustre/obdfilter/*OST*")
    if len(osts) != 0:
        fsname, _ = os.path.basename(osts[0]).split("-")
        for ost in osts:
            ostnames.append(os.path.basename(ost))
    return fsname, ostnames

def get_filehandler(f, m="w", level=logging.DEBUG):
    fh = logging.FileHandler(filename=f, mode=m)
    fh.setLevel(level)
    fh.setFormatter(G.fmt)
    return fh

def get_consolehandler(level=logging.DEBUG):
    ch = logging.StreamHandler()
    ch.setLevel(level)
    ch.setFormatter(G.fmt)
    return ch




0f8faf6c3aee6544f608b8008dde508a60aef08a
<mask token>


class G:
    fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'


<mask token>


def get_consolehandler(level=logging.DEBUG):
    ch = logging.StreamHandler()
    ch.setLevel(level)
    ch.setFormatter(G.fmt)
    return ch

<mask token>


class G:
    fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'


<mask token>


def get_filehandler(f, m='w', level=logging.DEBUG):
    fh = logging.FileHandler(filename=f, mode=m)
    fh.setLevel(level)
    fh.setFormatter(G.fmt)
    return fh


def get_consolehandler(level=logging.DEBUG):
    ch = logging.StreamHandler()
    ch.setLevel(level)
    ch.setFormatter(G.fmt)
    return ch

<mask token>


class G:
    fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'


def scan_osts():
    fsname = None
    ostnames = []
    osts = glob.glob('/proc/fs/lustre/obdfilter/*OST*')
    if len(osts) != 0:
        fsname, _ = os.path.basename(osts[0]).split('-')
        for ost in osts:
            ostnames.append(os.path.basename(ost))
    return fsname, ostnames


def get_filehandler(f, m='w', level=logging.DEBUG):
    fh = logging.FileHandler(filename=f, mode=m)
    fh.setLevel(level)
    fh.setFormatter(G.fmt)
    return fh


def get_consolehandler(level=logging.DEBUG):
    ch = logging.StreamHandler()
    ch.setLevel(level)
    ch.setFormatter(G.fmt)
    return ch

import os
import glob
import logging


class G:
    fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'


def scan_osts():
    fsname = None
    ostnames = []
    osts = glob.glob('/proc/fs/lustre/obdfilter/*OST*')
    if len(osts) != 0:
        fsname, _ = os.path.basename(osts[0]).split('-')
        for ost in osts:
            ostnames.append(os.path.basename(ost))
    return fsname, ostnames


def get_filehandler(f, m='w', level=logging.DEBUG):
    fh = logging.FileHandler(filename=f, mode=m)
    fh.setLevel(level)
    fh.setFormatter(G.fmt)
    return fh


def get_consolehandler(level=logging.DEBUG):
    ch = logging.StreamHandler()
    ch.setLevel(level)
    ch.setFormatter(G.fmt)
    return ch

#!/usr/bin/env python

import os
import glob
import logging

class G:
    fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'

def scan_osts():
    fsname = None
    ostnames = []
    osts = glob.glob("/proc/fs/lustre/obdfilter/*OST*")
    if len(osts) != 0:
        fsname, _ = os.path.basename(osts[0]).split("-")
        for ost in osts:
            ostnames.append(os.path.basename(ost))
    return fsname, ostnames

def get_filehandler(f, m="w", level=logging.DEBUG):
    fh = logging.FileHandler(filename=f, mode=m)
    fh.setLevel(level)
    fh.setFormatter(G.fmt)
    return fh

def get_consolehandler(level=logging.DEBUG):
    ch = logging.StreamHandler()
    ch.setLevel(level)
    ch.setFormatter(G.fmt)
    return ch



