Updated base image docker repo url
Also fixed some code deprecation warnings Change-Id: Ib92b609e9dbe3dd1051eff6b4bf1ca088157e586
This commit is contained in:
parent
e7b01efeb0
commit
e491bc4ca7
@ -18,7 +18,7 @@
|
|||||||
# 429 Too Many Requests - Server message: too many requests:
|
# 429 Too Many Requests - Server message: too many requests:
|
||||||
# You have reached your pull rate limit.
|
# You have reached your pull rate limit.
|
||||||
# You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
|
# You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
|
||||||
ARG FROM=public.ecr.aws/ubuntu/ubuntu:jammy
|
ARG FROM=public.ecr.aws/docker/library/ubuntu:jammy
|
||||||
FROM ${FROM}
|
FROM ${FROM}
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
|
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
|
||||||
|
@ -154,7 +154,7 @@ class PromenadeRequestContext(context.RequestContext):
|
|||||||
result['request_id'] = getattr(self, 'request_id', None)
|
result['request_id'] = getattr(self, 'request_id', None)
|
||||||
result['context_marker'] = getattr(self, 'context_marker', None)
|
result['context_marker'] = getattr(self, 'context_marker', None)
|
||||||
result['end_user'] = getattr(self, 'end_user', None)
|
result['end_user'] = getattr(self, 'end_user', None)
|
||||||
result['user'] = getattr(self, 'user', None)
|
result['user'] = getattr(self, 'user_id', None)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class AuthMiddleware(object):
|
|||||||
# Process account and roles
|
# Process account and roles
|
||||||
ctx.authenticated = True
|
ctx.authenticated = True
|
||||||
# User Identity, unique within owning domain
|
# User Identity, unique within owning domain
|
||||||
ctx.user = req.get_header(
|
ctx.user_id = req.get_header(
|
||||||
'X-SERVICE-USER-NAME') if service else req.get_header(
|
'X-SERVICE-USER-NAME') if service else req.get_header(
|
||||||
'X-USER-NAME')
|
'X-USER-NAME')
|
||||||
# Identity-service managed unique identifier
|
# Identity-service managed unique identifier
|
||||||
@ -77,7 +77,7 @@ class AuthMiddleware(object):
|
|||||||
ctx.is_admin_project = False
|
ctx.is_admin_project = False
|
||||||
|
|
||||||
LOG.debug('Request from authenticated user %s with roles %s',
|
LOG.debug('Request from authenticated user %s with roles %s',
|
||||||
ctx.user, ctx.roles)
|
ctx.user_id, ctx.roles)
|
||||||
else:
|
else:
|
||||||
ctx.authenticated = False
|
ctx.authenticated = False
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class ContextMiddleware(object):
|
|||||||
if end_user is not None:
|
if end_user is not None:
|
||||||
ctx.set_end_user(end_user)
|
ctx.set_end_user(end_user)
|
||||||
else:
|
else:
|
||||||
ctx.set_end_user(ctx.user)
|
ctx.set_end_user(ctx.user_id)
|
||||||
|
|
||||||
|
|
||||||
class LoggingMiddleware(object):
|
class LoggingMiddleware(object):
|
||||||
@ -139,7 +139,7 @@ class LoggingMiddleware(object):
|
|||||||
else:
|
else:
|
||||||
context_marker = getattr(ctx, 'context_marker', None)
|
context_marker = getattr(ctx, 'context_marker', None)
|
||||||
request_id = getattr(ctx, 'request_id', None)
|
request_id = getattr(ctx, 'request_id', None)
|
||||||
user = getattr(ctx, 'user', None)
|
user = getattr(ctx, 'user_id', None)
|
||||||
end_user = getattr(ctx, 'end_user', None)
|
end_user = getattr(ctx, 'end_user', None)
|
||||||
if context_marker is not None:
|
if context_marker is not None:
|
||||||
resp.append_header('X-CONTEXT-MARKER', context_marker)
|
resp.append_header('X-CONTEXT-MARKER', context_marker)
|
||||||
|
@ -127,7 +127,7 @@ def default_error_serializer(req, resp, exception):
|
|||||||
info_list=None)
|
info_list=None)
|
||||||
|
|
||||||
|
|
||||||
def default_exception_handler(ex, req, resp, params):
|
def default_exception_handler(req, resp, ex, params):
|
||||||
"""
|
"""
|
||||||
Catch-all exception handler for standardized output.
|
Catch-all exception handler for standardized output.
|
||||||
If this is a standard falcon HTTPError, rethrow it for handling
|
If this is a standard falcon HTTPError, rethrow it for handling
|
||||||
@ -198,7 +198,7 @@ class PromenadeException(Exception):
|
|||||||
return '{} : {}'.format(ttl, dsc)
|
return '{} : {}'.format(ttl, dsc)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def handle(ex, req, resp, params):
|
def handle(req, resp, ex, params):
|
||||||
"""
|
"""
|
||||||
The handler used for app errors and child classes
|
The handler used for app errors and child classes
|
||||||
"""
|
"""
|
||||||
|
@ -4,7 +4,7 @@ import datetime
|
|||||||
import io
|
import io
|
||||||
import jinja2
|
import jinja2
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
from importlib.resources import files
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@ -49,8 +49,7 @@ def insert_charts_into_bundler(bundler):
|
|||||||
|
|
||||||
|
|
||||||
def render_role_into_bundler(*, bundler, config, role):
|
def render_role_into_bundler(*, bundler, config, role):
|
||||||
role_root = pkg_resources.resource_filename(
|
role_root = files('promenade').joinpath('templates', 'roles', role)
|
||||||
'promenade', os.path.join('templates', 'roles', role))
|
|
||||||
for root, _dirnames, filenames in os.walk(role_root, followlinks=True):
|
for root, _dirnames, filenames in os.walk(role_root, followlinks=True):
|
||||||
destination_base = os.path.relpath(root, role_root)
|
destination_base = os.path.relpath(root, role_root)
|
||||||
for source_filename in filenames:
|
for source_filename in filenames:
|
||||||
@ -89,12 +88,12 @@ def render_template(config, *, template, context=None, roles=None):
|
|||||||
if roles is None:
|
if roles is None:
|
||||||
roles = {}
|
roles = {}
|
||||||
|
|
||||||
template_contents = pkg_resources.resource_string(
|
template_path = files('promenade') / 'templates' / template
|
||||||
'promenade', os.path.join('templates', template))
|
template_contents = template_path.read_text(encoding='utf-8')
|
||||||
|
|
||||||
env = _build_env()
|
env = _build_env()
|
||||||
|
|
||||||
template_obj = env.from_string(template_contents.decode('utf-8'))
|
template_obj = env.from_string(template_contents)
|
||||||
try:
|
try:
|
||||||
return template_obj.render(config=config, roles=roles, **context)
|
return template_obj.render(config=config, roles=roles, **context)
|
||||||
except jinja2.exceptions.TemplateRuntimeError as e:
|
except jinja2.exceptions.TemplateRuntimeError as e:
|
||||||
|
@ -17,7 +17,7 @@ from promenade import logging
|
|||||||
from promenade.utils.validation_message import ValidationMessage
|
from promenade.utils.validation_message import ValidationMessage
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
from importlib.resources import files
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
__all__ = ['check_schema', 'check_schemas', 'validate_all']
|
__all__ = ['check_schema', 'check_schemas', 'validate_all']
|
||||||
@ -147,7 +147,7 @@ def _load_schemas():
|
|||||||
|
|
||||||
|
|
||||||
def _get_schema_dir():
|
def _get_schema_dir():
|
||||||
return pkg_resources.resource_filename('promenade', 'schemas')
|
return str(files('promenade') / 'schemas')
|
||||||
|
|
||||||
|
|
||||||
# Fill the cache
|
# Fill the cache
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Deckhand @ git+https://opendev.org/airship/deckhand.git@dacedae17b71acd249dc01ad0540e58136245fe1#egg=deckhand
|
Deckhand @ git+https://opendev.org/airship/deckhand.git@4d500e48e880ea7f9a3582324c55c61373a855ea#egg=deckhand
|
||||||
Beaker
|
Beaker
|
||||||
click
|
click
|
||||||
falcon
|
falcon
|
||||||
|
@ -15,7 +15,7 @@ cliff==4.8.0
|
|||||||
cmd2==2.5.8
|
cmd2==2.5.8
|
||||||
cryptography==42.0.8
|
cryptography==42.0.8
|
||||||
debtcollector==3.0.0
|
debtcollector==3.0.0
|
||||||
Deckhand @ git+https://opendev.org/airship/deckhand.git@dacedae17b71acd249dc01ad0540e58136245fe1
|
Deckhand @ git+https://opendev.org/airship/deckhand.git@4d500e48e880ea7f9a3582324c55c61373a855ea
|
||||||
decorator==5.1.1
|
decorator==5.1.1
|
||||||
deepdiff==8.1.1
|
deepdiff==8.1.1
|
||||||
dnspython==2.7.0
|
dnspython==2.7.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user