import collections import copy import glob import platform import re import shlex import yaml from anvil import colorizer from anvil import exceptions as excp from anvil import importer from anvil import log as logging from anvil import shell as sh LOG = logging.getLogger(__name__) Component = collections.namedtuple( # pylint: disable=C0103 "Component", 'entry_point,options,siblings') class Distro(object): def __init__(self, name, platform_pattern, install_helper, dependency_handler, commands, components): self.name = name self._platform_pattern = re.compile(platform_pattern, re.IGNORECASE) self._install_helper = install_helper self._dependency_handler = dependency_handler self._commands = commands
from anvil import actions from anvil import colorizer from anvil import distro from anvil import exceptions as excp from anvil import log as logging from anvil import opts from anvil.packaging import yum from anvil import persona from anvil import pprint from anvil import settings from anvil import shell as sh from anvil import utils LOG = logging.getLogger() def run(args): """Starts the execution after args have been parsed and logging has been setup. """ LOG.debug("CLI arguments are:") utils.log_object(args, logger=LOG, level=logging.DEBUG, item_max_len=128) # Keep the old args around so we have the full set to write out saved_args = dict(args) action = args.pop("action", "").strip().lower() if re.match(r"^moo[o]*$", action): return
sys.path.insert(0, os.path.abspath(os.getcwd())) from anvil import actions from anvil import colorizer from anvil import distro from anvil import exceptions as excp from anvil import log as logging from anvil import opts from anvil import origins as _origins from anvil import persona from anvil import pprint from anvil import settings from anvil import shell as sh from anvil import utils LOG = logging.getLogger() SETTINGS_FILE = "/etc/anvil/settings.yaml" ANVIL_DIRS = tuple(["/etc/anvil/", '/usr/share/anvil/']) def run(args): """Starts the execution after args have been parsed and logging has been setup. """ LOG.debug("CLI arguments are:") utils.log_object(args, logger=LOG, level=logging.DEBUG, item_max_len=128) # Keep the old args around so we have the full set to write out saved_args = dict(args) action = args.pop("action", '').strip().lower() if re.match(r"^moo[o]*$", action):
def setUp(self): super(TestLog, self).setUp() self.test_logger = log.getLogger().logger self.test_logger.handlers = [] self.log_name = tempfile.mkstemp()[1]