Cherry-pick changes from release-0.2.

* Fix leaking password in conductor's logs.
  Fixes: bug MRN-861.
  I8130794ed9802cddfbb2f7ed285e3c13c8f05473
* Change version prefix to 0.2
  Also pbr version was synchronized with other murano
  compoments to avoid pip conflicts.
  I5222146695513b6be7a9ef6c981f6b9905a53dff

Change-Id: I80d1f67521a62878d68c800f4f648db43fb2ad9b
This commit is contained in:
Timur Sufiev 2013-09-03 18:59:54 +04:00
parent 0c660bea1b
commit 03dce95278
7 changed files with 20 additions and 20 deletions

View File

@ -27,7 +27,7 @@ from config import Config
import reporting import reporting
from muranocommon.messaging import MqClient, Message from muranocommon.messaging import MqClient, Message
from muranoconductor import config as cfg from muranoconductor import config as cfg
from muranoconductor.helpers import secure_data from muranocommon.helpers.token_sanitizer import TokenSanitizer
import windows_agent import windows_agent
import cloud_formation import cloud_formation
@ -80,8 +80,9 @@ class ConductorWorkflowService(service.Service):
message_id = message.id message_id = message.id
with self.create_rmq_client() as mq: with self.create_rmq_client() as mq:
try: try:
secure_task = TokenSanitizer().sanitize(task)
log.info('Starting processing task {0}: {1}'.format( log.info('Starting processing task {0}: {1}'.format(
message_id, anyjson.dumps(secure_data(task)))) message_id, anyjson.dumps(secure_task)))
reporter = reporting.Reporter(mq, message_id, task['id']) reporter = reporting.Reporter(mq, message_id, task['id'])
config = Config() config = Config()
@ -136,7 +137,7 @@ class ConductorWorkflowService(service.Service):
mq.send(message=result_msg, key='task-results') mq.send(message=result_msg, key='task-results')
message.ack() message.ack()
log.info('Finished processing task {0}. Result = {1}'.format( log.info('Finished processing task {0}. Result = {1}'.format(
message_id, anyjson.dumps(secure_data(task)))) message_id, anyjson.dumps(TokenSanitizer().sanitize(task))))
def cleanup(self, model, reporter): def cleanup(self, model, reporter):
try: try:

View File

@ -6,6 +6,7 @@ from muranoconductor.openstack.common import log as logging
from muranocommon.messaging import Message from muranocommon.messaging import Message
import muranoconductor.helpers import muranoconductor.helpers
from command import CommandBase from command import CommandBase
from muranocommon.helpers.token_sanitizer import TokenSanitizer
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -44,7 +45,7 @@ class WindowsAgentExecutor(CommandBase):
self._rmqclient.declare(queue) self._rmqclient.declare(queue)
self._rmqclient.send(message=msg, key=queue) self._rmqclient.send(message=msg, key=queue)
log.info('Sending RMQ message {0} to {1} with id {2}'.format( log.info('Sending RMQ message {0} to {1} with id {2}'.format(
template_data, queue, msg_id)) TokenSanitizer().sanitize(template_data), queue, msg_id))
def encode_scripts(self, json_data, template_path): def encode_scripts(self, json_data, template_path):
scripts_folder = 'data/templates/agent/scripts' scripts_folder = 'data/templates/agent/scripts'

View File

@ -15,7 +15,6 @@
import deep import deep
import types import types
from muranocommon.helpers.token_sanitizer import TokenSanitizer
def transform_json(json, mappings): def transform_json(json, mappings):
@ -101,8 +100,3 @@ def str2unicode(obj):
elif isinstance(obj, types.ListType): elif isinstance(obj, types.ListType):
return [str2unicode(t) for t in obj] return [str2unicode(t) for t in obj]
return obj return obj
def secure_data(data):
sanitizer = TokenSanitizer()
return sanitizer.sanitize(data)

View File

@ -20,7 +20,7 @@ import types
import function_context import function_context
import xml_code_engine import xml_code_engine
from muranoconductor.helpers import secure_data from muranocommon.helpers.token_sanitizer import TokenSanitizer
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
object_id = id object_id = id
@ -137,6 +137,9 @@ class Workflow(object):
@staticmethod @staticmethod
def _set_func(path, context, body, engine, target=None, **kwargs): def _set_func(path, context, body, engine, target=None, **kwargs):
def secure_data(*args):
return TokenSanitizer().sanitize(args)
body_data = engine.evaluate_content(body, context) body_data = engine.evaluate_content(body, context)
if path.startswith('##'): if path.startswith('##'):
@ -145,7 +148,7 @@ class Workflow(object):
context_path = ':' + path[1:] context_path = ':' + path[1:]
log.debug( log.debug(
"Setting context variable '{0}' to '{1}'".format( "Setting context variable '{0}' to '{1}'".format(
*secure_data((context_path, body_data)))) *secure_data(context_path, body_data)))
context[context_path] = body_data context[context_path] = body_data
return return
if target: if target:
@ -153,7 +156,7 @@ class Workflow(object):
position = path.split('.') position = path.split('.')
if Workflow._get_path(data, position) != body_data: if Workflow._get_path(data, position) != body_data:
log.debug("Setting '{0}' to '{1}'".format( log.debug("Setting '{0}' to '{1}'".format(
*secure_data((path, body_data)))) *secure_data(path, body_data)))
Workflow._set_path(data, position, body_data) Workflow._set_path(data, position, body_data)
context['/hasSideEffects'] = True context['/hasSideEffects'] = True
@ -162,7 +165,7 @@ class Workflow(object):
new_position = Workflow._correct_position(path, context) new_position = Workflow._correct_position(path, context)
if Workflow._get_path(data, new_position) != body_data: if Workflow._get_path(data, new_position) != body_data:
log.debug("Setting '{0}' to '{1}'".format( log.debug("Setting '{0}' to '{1}'".format(
*secure_data((path, body_data)))) *secure_data(path, body_data)))
Workflow._set_path(data, new_position, body_data) Workflow._set_path(data, new_position, body_data)
context['/hasSideEffects'] = True context['/hasSideEffects'] = True
@ -231,8 +234,9 @@ class Workflow(object):
context['__dataSource_currentObj'] = cur_obj context['__dataSource_currentObj'] = cur_obj
context['__dataSource_currentObj_id'] = current_object_id context['__dataSource_currentObj_id'] = current_object_id
secure_obj = TokenSanitizer().sanitize(cur_obj)
log.debug("Rule '{0}' with ID = {2} matches on '{1}'" log.debug("Rule '{0}' with ID = {2} matches on '{1}'"
.format(desc, secure_data(cur_obj), full_rule_id)) .format(desc, secure_obj, full_rule_id))
if current_object_id != '#': if current_object_id != '#':
log.debug('Muting {0} in rule {1}'.format( log.debug('Muting {0} in rule {1}'.format(
current_object_id, full_rule_id)) current_object_id, full_rule_id))

View File

@ -1,4 +1,4 @@
pbr>=0.5.21,<1.0 pbr>=0.5,<0.6
anyjson anyjson
eventlet>=0.9.12 eventlet>=0.9.12
jsonpath jsonpath
@ -11,4 +11,4 @@ netaddr
oslo.config oslo.config
deep deep
murano-common>=0.2.2 murano-common>=0.2.2

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
name = murano-conductor name = murano-conductor
summary = The Conductor is orchestration engine server summary = The Conductor is orchestration engine server
version = 2013.1 version = 0.2
description-file = description-file =
README.rst README.rst
license = Apache License, Version 2.0 license = Apache License, Version 2.0
@ -61,4 +61,4 @@ output_file = muranoconductor/locale/conductor.pot
verbosity=2 verbosity=2
cover-package = muranoconductor cover-package = muranoconductor
cover-html = true cover-html = true
cover-erase = true cover-erase = true

View File

@ -19,7 +19,7 @@ import setuptools
setuptools.setup( setuptools.setup(
setup_requires=[ setup_requires=[
'd2to1>=0.2.10,<0.3', 'd2to1>=0.2.10,<0.3',
'pbr>=0.5.21,<1.0' 'pbr>=0.5,<0.6'
], ],
d2to1=True, d2to1=True,
pbr=True pbr=True