Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.2.3' into 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristinaMeno committed Jul 28, 2015
2 parents 8c19349 + 3e40287 commit ad1786b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -5,9 +5,11 @@ virtualenv:
python:
- "2.7"
before_install:
- sudo apt-get -y install python-software-properties
- sudo add-apt-repository -y ppa:saltstack/salt
- sudo apt-get update
- curl -L http://bootstrap.saltstack.org | sudo sh -s
install:
- sudo apt-get -y install salt-master salt-minion salt-common
- sudo salt-call --retcode-passthrough --local state.template vagrant/devmode/salt/roots/build_deps.sls
- sudo salt-call --retcode-passthrough --local state.template vagrant/devmode/salt/roots/postgres.sls
- pip install pyzmq==14.1.1 --install-option="--zmq=bundled"
Expand Down
43 changes: 31 additions & 12 deletions calamari-common/calamari_common/salt_wrapper.py
Expand Up @@ -11,30 +11,49 @@
import gevent
import logging

from calamari_common.config import CalamariConfig

FORMAT = "%(asctime)s - %(levelname)s - %(name)s %(message)s"
log = logging.getLogger(__name__)
config = CalamariConfig()

# log to cthulhu.log
handler = logging.FileHandler(config.get('cthulhu', 'log_path'))
handler.setFormatter(logging.Formatter(FORMAT))
log.addHandler(handler)

# log to calamari.log
handler = logging.FileHandler(config.get('calamari_web', 'log_path'))
handler.setFormatter(logging.Formatter(FORMAT))
log.addHandler(handler)

log.addHandler(logging.StreamHandler())

log.setLevel(logging.getLevelName(config.get('cthulhu', 'log_level')))

try:
try:
from salt.client import condition_kwarg
from salt.client import condition_kwarg # noqa
except ImportError:
# Salt moved this in 382dd5e
from salt.utils.args import condition_input as condition_kwarg
from salt.utils.args import condition_input as condition_kwarg # noqa

from salt.client import LocalClient # noqa
from salt.utils.event import MasterEvent # noqa
from salt.key import Key # noqa
from salt.config import master_config # noqa
from salt.utils.master import MasterPillarUtil # noqa
from salt.config import client_config # noqa
from salt.loader import _create_loader
except ImportError:
condition_kwarg = None
LocalClient = None
MasterEvent = None
Key = None
master_config = None
MasterPillarUtil = None
client_config = lambda x: None
_create_loader = None
try:
from salt.loader import _create_loader # noqa
except ImportError:
# static_loader added in a422fa42
# _create_loader removed in b0e1425
from salt.loader import static_loader as _create_loader # noqa
except ImportError, e:
# log failure everywhere and give up
log.exception(e)
raise e


class SaltEventSource(object):
Expand Down

0 comments on commit ad1786b

Please sign in to comment.