本文整理汇总了Python中mistral.openstack.common.log.getLogger函数的典型用法代码示例。如果您正苦于以下问题:Python getLogger函数的具体用法?Python getLogger怎么用?Python getLogger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLogger函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TODO
# limitations under the License.
import mock
from oslo.config import cfg
from mistral.actions import std_actions
from mistral.db import api as db_api
from mistral import engine
from mistral.engine.drivers.default import engine as concrete_engine
from mistral.engine import states
from mistral import expressions
from mistral.openstack.common import log as logging
from mistral.tests import base
LOG = logging.getLogger(__name__)
WB_NAME = "my_workbook"
CONTEXT = None # TODO(rakhmerov): Use a meaningful value.
# Use the set_default method to set value otherwise in certain test cases
# the change in value is not permanent.
cfg.CONF.set_default('auth_enable', False, group='pecan')
# TODO(rakhmerov): add more tests for errors, execution stop etc.
@mock.patch.object(
engine.EngineClient, 'start_workflow_execution',
mock.MagicMock(side_effect=base.EngineTestCase.mock_start_workflow))
@mock.patch.object(
示例2: get_task_runtime
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo.config import cfg
from mistral.engine import states
from mistral import expressions
from mistral.openstack.common import log as logging
WORKFLOW_TRACE = logging.getLogger(cfg.CONF.workflow_trace_log_name)
def get_task_runtime(task_spec, state=states.IDLE, outbound_context=None,
task_runtime_context=None):
"""Computes the state and exec_flow_context runtime properties for a task
based on the supplied properties. This method takes the retry nature of a
task into consideration.
:param task_spec: specification of the task
:param state: suggested next state
:param outbound_context: outbound_context to be used for computation
:param task_runtime_context: current flow context
:return: state, exec_flow_context tuple. Sample scenarios are,
1. state = SUCCESS
No need to move to next iteration.
示例3: UpdateStackAction
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from mistral.actions import std_actions
from mistral import exceptions
from mistral.openstack.common import log as logging
LOG = logging.getLogger('mistral.actions.solum')
class UpdateStackAction(std_actions.HTTPAction):
def __init__(self, heat_service_url, action_context,
stack_name, stack_id, parameters, image_id, template):
merged_parms = parameters or {}
merged_parms['image'] = image_id
super(UpdateStackAction, self).__init__(
url='%s/stacks/%s/%s' % (heat_service_url, stack_name, stack_id),
method='PUT',
headers={'X-Auth-Token': action_context['openstack']['auth_token'],
'Content-Type': 'application/json',
'User-Agent': 'mistral-heat-plugin',
'Accept': 'application/json'},
body={'stack_id': stack_id,
示例4: main
os.pardir,
os.pardir))
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'mistral', '__init__.py')):
sys.path.insert(0, POSSIBLE_TOPDIR)
from oslo import messaging
from oslo.config import cfg
from mistral import config
from mistral.engine import engine
from mistral.engine.scalable.executor import server
from mistral.openstack.common import log as logging
LOG = logging.getLogger('mistral.cmd.task_executor')
def main():
try:
config.parse_args()
logging.setup('Mistral')
# TODO(rakhmerov): This is a temporary hack.
# We have to initialize engine in executor process because
# executor now calls engine.convey_task_result() directly.
engine.load_engine()
# Please refer to the oslo.messaging documentation for transport
# configuration. The default transport for oslo.messaging is rabbitMQ.
# The available transport drivers are listed under oslo.messaging at
示例5: main
from wsgiref import simple_server
from oslo.config import cfg
from mistral.api import app
from mistral import config
from mistral.openstack.common import log as logging
eventlet.monkey_patch(
os=True,
select=True,
socket=True,
thread=False if '--use-debugger' in sys.argv else True,
time=True)
LOG = logging.getLogger('mistral.cmd.api')
def main():
try:
config.parse_args()
logging.setup('Mistral')
host = cfg.CONF.api.host
port = cfg.CONF.api.port
server = simple_server.make_server(host, port, app.setup_app())
LOG.info("Mistral API is serving on http://%s:%s (PID=%s)" %
(host, port, os.getpid()))