Revert "Add config option default_data_file"
default_data_uri option handles local file already, path need to be
prefixed with 'file://', for example:
default_data_uri = file:///path/to/default_data.json
This reverts commit 1888bfb60c.
Change-Id: I558238dbfc633793013451f836c7ce449e94c6c5
Signed-off-by: Pierre-Louis Bonicoli <pierre-louis.bonicoli@libregerbil.fr>
This commit is contained in:
@@ -24,9 +24,6 @@ CONNECTION_OPTS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
PROCESSOR_OPTS = [
|
PROCESSOR_OPTS = [
|
||||||
cfg.StrOpt('default-data-file',
|
|
||||||
help='Default data file. This file is used instead of '
|
|
||||||
'default-data-uri if specifying.'),
|
|
||||||
cfg.StrOpt('default-data-uri',
|
cfg.StrOpt('default-data-uri',
|
||||||
default='https://git.openstack.org/cgit/'
|
default='https://git.openstack.org/cgit/'
|
||||||
'openstack/stackalytics/plain/etc/default_data.json',
|
'openstack/stackalytics/plain/etc/default_data.json',
|
||||||
|
|||||||
@@ -313,9 +313,6 @@ def main():
|
|||||||
runtime_storage_inst = runtime_storage.get_runtime_storage(
|
runtime_storage_inst = runtime_storage.get_runtime_storage(
|
||||||
CONF.runtime_storage_uri)
|
CONF.runtime_storage_uri)
|
||||||
|
|
||||||
if CONF.default_data_file:
|
|
||||||
default_data = utils.read_json_from_file(CONF.default_data_file)
|
|
||||||
else:
|
|
||||||
default_data = utils.read_json_from_uri(CONF.default_data_uri)
|
default_data = utils.read_json_from_uri(CONF.default_data_uri)
|
||||||
if not default_data:
|
if not default_data:
|
||||||
LOG.critical('Unable to load default data')
|
LOG.critical('Unable to load default data')
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import re
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import iso8601
|
import iso8601
|
||||||
import json
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import requests
|
import requests
|
||||||
@@ -152,12 +151,6 @@ def read_json_from_uri(uri, session=None):
|
|||||||
{'error': e, 'uri': uri})
|
{'error': e, 'uri': uri})
|
||||||
|
|
||||||
|
|
||||||
def read_json_from_file(filename):
|
|
||||||
with open(filename) as json_data:
|
|
||||||
data = json.load(json_data)
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def read_yaml_from_uri(uri):
|
def read_yaml_from_uri(uri):
|
||||||
try:
|
try:
|
||||||
return yaml.safe_load(read_uri(uri))
|
return yaml.safe_load(read_uri(uri))
|
||||||
|
|||||||
Reference in New Issue
Block a user