Esempio n. 1
0
from glanceclient.v2 import client as glanceclient
from heatclient.v1 import client as heatclient
from keystoneclient import httpclient
from keystoneclient.v3 import client as keystoneclient
from neutronclient.v2_0 import client as neutronclient
from novaclient.v2 import client as novaclient
from oslo.config import cfg

from blog.actions.openstack import base
from blog import context
from blog import exceptions as exc
from blog.openstack.common import log
from blog.utils.openstack import keystone as keystone_utils


LOG = log.getLogger(__name__)

CONF = cfg.CONF


class NovaAction(base.OpenStackAction):
    _client_class = novaclient.Client

    def _get_client(self):
        ctx = context.ctx()

        LOG.debug("Nova action security context: %s" % ctx)

        keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
        nova_endpoint = keystone_utils.get_endpoint_for_project('nova')
Esempio n. 2
0
import os
import shutil
import subprocess
import sys
import tempfile
import threading
import time
import weakref

from oslo.config import cfg

from blog.openstack.common import fileutils
from blog.openstack.common.gettextutils import _, _LE, _LI
from blog.openstack.common import log as logging

LOG = logging.getLogger(__name__)

util_opts = [
    cfg.BoolOpt('disable_process_locking',
                default=False,
                help='Enables or disables inter-process locks.'),
    cfg.StrOpt('lock_path',
               default=os.environ.get("MISTRAL_LOCK_PATH"),
               help='Directory to use for lock files.')
]

CONF = cfg.CONF
CONF.register_opts(util_opts)


def set_defaults(lock_path):
Esempio n. 3
0
#
#        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 blog.db.v1.sqlalchemy import models
from blog.openstack.common import log as logging

cfg.CONF.import_opt('workflow_trace_log_name', 'mistral.config')
WF_TRACE = logging.getLogger(cfg.CONF.workflow_trace_log_name)


def info(obj, msg, *args, **kvargs):
    """Logs workflow trace record for Execution or Task.

    :param obj: If type is TaskExecution or WorkflowExecution,
        appends execution_id and task_id to the log message.

    The rest of parameters follow logger.info(...)
    """
    debug_info = ''

    if type(obj) is models.TaskExecution:
        exec_id = obj.workflow_execution_id
        task_id = obj.id