Exemplo n.º 1
0
def list_opts():
    return [
        ("api", (
            cfg.PortOpt('port',
                        default=8888,
                        help=_('The port for the Evoque API server.')),
            cfg.StrOpt('host',
                       default='0.0.0.0',
                       help=_('The listen IP for the Evoque API server.')),
            cfg.BoolOpt('pecan_debug',
                        default=False,
                        help=_('Toggle Pecan Debug Middleware.')),
            cfg.IntOpt('workers', default=default_workers,
                       help=_('Number of workers for Evoque API server.')),
            cfg.IntOpt('max_limit',
                       default=1000,
                       help=_('The maximum number of items returned in a '
                              'single response from a collection resource')),
            cfg.BoolOpt('enable_authentication',
                        default=True,
                        help=_('This option enables or disables user '
                               'authentication via Keystone. '
                               'Default value is True.')),
        )),
        ("DEFAULT", (
            cfg.StrOpt('host',
                       default=socket.getfqdn(),
                       help=_('The listen IP for the Evoque engine server.')),
            cfg.StrOpt('workflow_engine',
                       default='spiff',
                       help=_('The Evoque workflow engine driver.')),
        )),
    ]
Exemplo n.º 2
0
def _paginate_query(model, limit=None, marker=None, sort_key=None,
                    sort_dir=None, query=None):
    if not query:
        query = model_query(model)
    sort_keys = ['id']
    if sort_key and sort_key not in sort_keys:
        sort_keys.insert(0, sort_key)
    try:
        query = db_utils.paginate_query(query, model, limit, sort_keys,
                                        marker=marker, sort_dir=sort_dir)
    except db_exc.InvalidSortKey:
        raise exceptions.InvalidParameterValue(
            _('The sort_key value "%(key)s" is an invalid field for sorting')
            % {'key': sort_key})
    return query.all()
Exemplo n.º 3
0
    def __init__(self, app, conf, public_api_routes=None):
        if public_api_routes is None:
            public_api_routes = []
        route_pattern_tpl = '%s\.json?$'

        try:
            self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl)
                                      for route_tpl in public_api_routes]
        except re.error as e:
            msg = _('Cannot compile public API routes: %s') % e

            LOG.error(msg)
            raise exceptions.ConfigInvalid(error_msg=msg)

        super(AuthTokenMiddleware, self).__init__(app, conf)
Exemplo n.º 4
0
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import abc
import six

from oslo_config import cfg
from stevedore import driver

from evoque.common.i18n import _

OPTS = [
    cfg.StrOpt('workflow_engine',
               default='spiff',
               help=_('The Evoque workflow engine driver.')),
]

CONF = cfg.CONF
CONF.register_opts(OPTS)


def get_workflow(engine=CONF.workflow_engine, namespace='evoque.workflow'):
    """Get workflow driver and load it.

    :param engine: workflow engine
    :param namespace: Namespace to use to look for drivers.
    """

    loaded_driver = driver.DriverManager(namespace, engine)
    return loaded_driver.driver()