Current File : //bin/vdo
#! /usr/libexec/platform-python

#
# Copyright Red Hat
#
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA. 
#

"""
  vdo - VDO management utility

  $Id: //eng/vdo-releases/aluminum/src/python/vdo/vdo#5 $

"""
#pylint: disable=C0302
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import argparse
import copy
import gettext
import logging
from logging.handlers import RotatingFileHandler
import locale
import os
import re
import sys
from textwrap import TextWrapper
import traceback

from vdo.utils import Command
from vdo.vdomgmnt import *

gettext.install('vdo')

########################################################################
def configureLogger(name, logfile = None, debug = False):
  """Configure the logging system according to the arguments."""
  debugging   = debug
  myname      = os.path.basename(sys.argv[0])
  formatBase  = ': %(levelname)s - %(message)s'
  debugBase   = (': %(name)s' if debugging else '') + formatBase

  logger = logging.getLogger()
  logger.setLevel(logging.NOTSET)

  handler = logging.StreamHandler(sys.stderr)
  handler.setFormatter(logging.Formatter(myname + debugBase))
  handler.setLevel(logging.DEBUG if debugging else logging.WARNING)
  logger.addHandler(handler)

  if logfile is not None:
    try:
      if os.path.isfile(logfile) or not os.path.exists(logfile):
        # Nonexistent or file, treat it as a file
        handler = RotatingFileHandler(logfile,
                                      maxBytes=10*1024*1024,
                                      backupCount=5)
      else:
        # Exists but not a file, treat it as a stream
        logstream = open(logfile, "w")
        handler = logging.StreamHandler(stream=logstream)

      formatter = logging.Formatter('%(asctime)s %(name)s' + formatBase)
      handler.setFormatter(formatter)
      handler.setLevel(logging.DEBUG if debugging else logging.INFO)
      logger.addHandler(handler)
    except Exception as ex:
      logger.error("Unable to configure logging to '{logfile}' {ex}"
                   .format(logfile=logfile, ex=ex))
      sys.exit(1)

  # syslog logger
  try:
    handler = logging.handlers.SysLogHandler(address='/dev/log')
    handler.setFormatter(logging.Formatter(myname + formatBase))
    handler.setLevel(logging.WARNING)
    logger.addHandler(handler)
  except Exception as ex:
    logger.warn('Unable to configure logging for rsyslog: {0}'.format(ex))

########################################################################
def main():
  """The main program.

     Exit codes:
       0        SUCCESS  success
       1        ERROR    error(s) occurred
  """
  SUCCESS = 0
  ERROR   = 1

  try:
    import vdoInstrumentation
  except ImportError:
    pass
  try:
    locale.setlocale(locale.LC_ALL, '')
  except locale.Error:
    pass

  arguments = VDOArgumentParser().parse_args()
  if arguments.command is None:
    # There does not appear to be a convenient way to get a command list.
    VDOArgumentParser().print_usage()
    sys.exit(ERROR)
  configureLogger(os.path.basename(sys.argv[0]),
                  arguments.logfile, arguments.debug)
  mainLogger = logging.getLogger(os.path.basename(sys.argv[0]))
  mainLogger.info(' '.join(['running'] + sys.argv))
  Command.setDefaults(arguments.verbose)

  operation = None
  exitval = ERROR
  try:
    operation = vdoOperations[arguments.command]
  except KeyError:
    mainLogger.error(_('Unknown command "{0}"'.format(arguments.command)))
  try:
    if operation is not None:
      operation.run(arguments)
      exitval = SUCCESS
  except Exception as ex:
    if isinstance(ex, ExitStatus):
      # pylint: disable=E1101
      # If it's an instance of ExitStatus we know it has exitStatus.
      exitval = ex.exitStatus
    traceInfo = sys.exc_info()[2]
    mainLogger.error(str(ex))
    # By default (i.e., without --debug) this will log to the
    # specified log file, if any, but not to stderr, because of the
    # priority thresholds we set for the different logging
    # destinations. We can't use mainLogger.exception because that
    # logs at level ERROR which would go everywhere.
    traceText = 'Traceback:\n' + ''.join(traceback.format_tb(traceInfo))
    mainLogger.info(traceText.rstrip())

  logging.shutdown()
  sys.exit(exitval)

########################################################################
if __name__ == "__main__":
  main()
Página 2

En construcción …

  • But not, the new 15x wagering demands to your put match causes it to be reduced worthwhile in practice compared to the also offers that have down betting conditions. Nonetheless, the newest zero-put part gives it an advantage over also provides without one.step 3. Games Eligibility (15%) – (4.0/5)The newest $20 added bonus is bound…

  • For those venturing right into the lively globe of on-line gaming, a well-designed incentive can be greater than simply a perk– it becomes part of the experience. I lately had the advantage of working together with the group at OnlyWin to create an engaging visual identification for their latest advertising emphasize, a no deposit bonus…

  • It’s in the much more than simply and therefore sportsbook contains the better opportunity – we view from customer service through to playing have and offers. Apple Shell out are a mobile purse choice much more recognized in the on the internet gambling web sites, especially on the programs which have mobile software. Fruit Pay…

  • A lot more basically, the opportunity calculator allows you to determine the entire odds of an excellent parlay wager, from to around one hundred selections. You can calculate the odds for an individual wager, a double wager, a triple choice (sometimes called a treble), or an excellent parlay level numerous events. It means a great…

  • You can find approximate dates however and Bing within the accurate week-end the entire year pay a visit to. Also, pre-booking a resort can be essential in specific occasion weekends. If you want to spend your day in the Klaipėda sightseeing, here are the greatest details utilizing your own ~7 totally free instances inside Klaipėda…

  • Avoid using an enthusiastic unlicensed gaming webpages as numerous of those are unethical and simply have to discount your finances. If this happens, there’s absolutely nothing can help you about this because there is zero licensing authority to. Our very own pros have verified you to definitely Sportsbetting.united states comes with a valid licenses which…

  • I siti di slot devono concedere preferenza alla variante mobilio, sviluppando app verso iOS addirittura Android ad esempio offrono un’esperienza di artificio snella. Questi concetti sono basilari a i giocatori, affinché influenzano le loro caso di vincita. Un payout di nuovo un RTP alti significano come il inganno è disinteressato anche restituisce una percentuale superiore…

  • Una versione interessante di corrente artificio è Book of Ra Magic, che aggiunge Casinò con prelievi rapidi nuove efficienza anche simboli speciali per rendere l’abilità ancora ancora avvincente. Il servizio di controllo clientela è rapido nel ambire di scegliere i problemi degli utenza. Le sezioni di appoggio sono complete di nuovo offrono informazioni aspetto agli fruitori…

  • Your wear’t buy gender ladysone nj because you perform with prostitutes – you only pay for their organization, and you may sex is a part of it… potentially. Escorts technically wear’t manage sexual features for money, but you to doesn’t indicate there’s zero intercourse involved.

  • Bilan acceptant disponible 24/7, jeu, établissement de bonus , ! arguments en compagnie de règlement allègres. Casino Cat mise dans une composition immersive mais auusi portail dans lesquels complet levant bien animé. En plus de proposer leurs collection utiles, cet salle de jeu compartiment nos rideaux pour examen allés. Avec 100 Quest, le but reste…