Skip to content
Snippets Groups Projects
Commit 42ad0fbd authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Fix use of deprecated functions and other warnings

parent 2f79c29d
No related branches found
No related tags found
No related merge requests found
...@@ -150,8 +150,6 @@ DEFAULT_ORGANIZATIONS = [ ...@@ -150,8 +150,6 @@ DEFAULT_ORGANIZATIONS = [
] ]
CONFIG_SCHEMA = { CONFIG_SCHEMA = {
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": { "definitions": {
"influx-datasource": { "influx-datasource": {
"type": "object", "type": "object",
......
import json import json
import logging.config import logging.config
import os import os
import pkg_resources from importlib.metadata import distribution
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration from sentry_sdk.integrations.flask import FlaskIntegration
...@@ -16,13 +16,12 @@ def setup_logging(): ...@@ -16,13 +16,12 @@ def setup_logging():
default_filename = os.path.join( default_filename = os.path.join(
os.path.dirname(__file__), 'logging_default_config.json') os.path.dirname(__file__), 'logging_default_config.json')
filename = os.getenv('LOGGING_CONFIG', default_filename) filename = os.getenv('LOGGING_CONFIG', default_filename)
sentry_dsn = os.getenv('SENTRY_DSN') sentry_dsn = os.getenv('SENTRY_DSN')
if sentry_dsn: if sentry_dsn:
sentry_sdk.init( sentry_sdk.init(
dsn=sentry_dsn, dsn=sentry_dsn,
integrations=[FlaskIntegration()], integrations=[FlaskIntegration()],
release=pkg_resources.get_distribution('brian-dashboard-manager').version) release=distribution('brian-dashboard-manager').version)
with open(filename) as f: with open(filename) as f:
# TODO: this mac workaround should be removed ... # TODO: this mac workaround should be removed ...
......
...@@ -62,7 +62,6 @@ _PORT_TYPES = [t.name for t in list(PORT_TYPES)] ...@@ -62,7 +62,6 @@ _PORT_TYPES = [t.name for t in list(PORT_TYPES)]
_INTERFACE_TYPES = [i.name for i in list(INTERFACE_TYPES)] _INTERFACE_TYPES = [i.name for i in list(INTERFACE_TYPES)]
ROUTER_INTERFACES_SCHEMA = { ROUTER_INTERFACES_SCHEMA = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array", "type": "array",
"items": { "items": {
"type": "object", "type": "object",
...@@ -89,8 +88,6 @@ ROUTER_INTERFACES_SCHEMA = { ...@@ -89,8 +88,6 @@ ROUTER_INTERFACES_SCHEMA = {
} }
INTERFACE_LIST_SCHEMA = { INTERFACE_LIST_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'definitions': { 'definitions': {
'service': { 'service': {
'type': 'object', 'type': 'object',
...@@ -137,8 +134,6 @@ INTERFACE_LIST_SCHEMA = { ...@@ -137,8 +134,6 @@ INTERFACE_LIST_SCHEMA = {
} }
GWS_DIRECT_DATA_SCHEMA = { GWS_DIRECT_DATA_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'definitions': { 'definitions': {
'oid': { 'oid': {
'type': 'string', 'type': 'string',
...@@ -214,8 +209,6 @@ GWS_DIRECT_DATA_SCHEMA = { ...@@ -214,8 +209,6 @@ GWS_DIRECT_DATA_SCHEMA = {
} }
MULTICAST_SUBSCRIPTION_LIST_SCHEMA = { MULTICAST_SUBSCRIPTION_LIST_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'definitions': { 'definitions': {
'ipv4-address': { 'ipv4-address': {
'type': 'string', 'type': 'string',
...@@ -243,7 +236,6 @@ MULTICAST_SUBSCRIPTION_LIST_SCHEMA = { ...@@ -243,7 +236,6 @@ MULTICAST_SUBSCRIPTION_LIST_SCHEMA = {
} }
NREN_REGION_LIST_SCHEMA = { NREN_REGION_LIST_SCHEMA = {
'$schema': 'https://json-schema.org/draft-07/schema#',
'definitions': { 'definitions': {
'nren_region': { 'nren_region': {
'type': 'object', 'type': 'object',
......
...@@ -13,7 +13,6 @@ from brian_dashboard_manager.config import STATE_PATH ...@@ -13,7 +13,6 @@ from brian_dashboard_manager.config import STATE_PATH
routes = Blueprint("update", __name__) routes = Blueprint("update", __name__)
UPDATE_RESPONSE_SCHEMA = { UPDATE_RESPONSE_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
'message': { 'message': {
......
import pkg_resources from importlib.metadata import distribution
from flask import Blueprint, jsonify from flask import Blueprint, jsonify
from brian_dashboard_manager.routes import common from brian_dashboard_manager.routes import common
...@@ -18,6 +17,6 @@ def version(): ...@@ -18,6 +17,6 @@ def version():
version_params = { version_params = {
'api': API_VERSION, 'api': API_VERSION,
'module': 'module':
pkg_resources.get_distribution('brian-dashboard-manager').version distribution('brian-dashboard-manager').version
} }
return jsonify(version_params) return jsonify(version_params)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment