Updated oracle fixtures

This commit is contained in:
dvanaken 2019-12-10 17:57:33 +01:00 committed by Dana Van Aken
parent 42e1a4add3
commit a3cc34ba8e
6 changed files with 32 additions and 26 deletions

View File

@ -138,6 +138,12 @@ def set_field(fields):
fields['maxval'] = 2000000000 # 2GB fields['maxval'] = 2000000000 # 2GB
fields['default'] = 500000000 # 500M fields['default'] = 500000000 # 500M
fields['resource'] = 1 fields['resource'] = 1
if fields['name'].lower() == 'db_32k_cache_size':
fields['tunable'] = False
fields['minval'] = 0
fields['maxval'] = 2000000000 # 2GB
fields['default'] = 500000000 # 500M
fields['resource'] = 1
if fields['name'].upper() == 'DB_RECYCLE_CACHE_SIZE': if fields['name'].upper() == 'DB_RECYCLE_CACHE_SIZE':
fields['tunable'] = False fields['tunable'] = False
fields['minval'] = 0 fields['minval'] = 0

View File

@ -1039,11 +1039,12 @@
"unit": 3, "unit": 3,
"tunable": false, "tunable": false,
"description": "", "description": "",
"minval": null, "minval": 0,
"maxval": null, "maxval": 2000000000,
"vartype": 2, "vartype": 2,
"default": "0", "default": 500000000,
"summary": "Size of cache for 32K buffers" "summary": "Size of cache for 32K buffers",
"resource": 1
} }
}, },
{ {

View File

@ -1324,11 +1324,12 @@
"unit": 3, "unit": 3,
"tunable": false, "tunable": false,
"description": "", "description": "",
"minval": null, "minval": 0,
"maxval": null, "maxval": 2000000000,
"vartype": 2, "vartype": 2,
"default": "0", "default": 500000000,
"summary": "Size of cache for 32K buffers" "summary": "Size of cache for 32K buffers",
"resource": 1
} }
}, },
{ {

View File

@ -1419,11 +1419,12 @@
"unit": 3, "unit": 3,
"tunable": false, "tunable": false,
"description": "", "description": "",
"minval": null, "minval": 0,
"maxval": null, "maxval": 2000000000,
"vartype": 2, "vartype": 2,
"default": "0", "default": 500000000,
"summary": "Size of cache for 32K buffers" "summary": "Size of cache for 32K buffers",
"resource": 1
} }
}, },
{ {

View File

@ -74,7 +74,7 @@ urlpatterns = [
url(r'^create/user/', website_views.alt_create_user, name='backdoor_create_user'), url(r'^create/user/', website_views.alt_create_user, name='backdoor_create_user'),
url(r'^delete/user/', website_views.alt_delete_user, name='backdoor_delete_user'), url(r'^delete/user/', website_views.alt_delete_user, name='backdoor_delete_user'),
url(r'^info/(?P<name>[0-9a-zA-Z]+)', website_views.alt_get_info, name="backdoor_info"), url(r'^info/(?P<name>[0-9a-zA-Z]+)', website_views.alt_get_info, name="backdoor_info"),
url(r'^set_constant/(?P<name>[0-9a-zA-Z_]+)', website_views.alt_set_constant, name="backdoor_set_constant"), url(r'^set_constants/', website_views.alt_set_constants, name="backdoor_set_constants"),
# train ddpg with results in the given session # train ddpg with results in the given session
url(r'^train_ddpg/sessions/(?P<session_id>[0-9]+)$', website_views.train_ddpg_loops, name='train_ddpg_loops'), url(r'^train_ddpg/sessions/(?P<session_id>[0-9]+)$', website_views.train_ddpg_loops, name='train_ddpg_loops'),

View File

@ -1141,19 +1141,16 @@ def alt_get_info(request, name):
@csrf_exempt @csrf_exempt
def alt_set_constant(request, name): def alt_set_constants(request):
# Sets a constant defined in settings/constants.py constants = JSONUtil.loads(request.POST.get('constants', '{}'))
LOG.info('POST: %s', request.POST) for name, value in constants.items():
LOG.info('POST.lists(): %s', request.POST.lists()) try:
value = request.POST['value'] utils.set_constant(name, value)
LOG.info('name: %s, value: %s, type: %s', name, value, type(value)) except AttributeError as e:
#data = {k: v[0] for k, v in request.POST.lists()} LOG.warning(e)
try: return HttpResponse(e, status=400)
utils.set_constant(name, value) return HttpResponse("Successfully updated constants: {}".format(
except AttributeError as e: ', '.join('{}={}'.format(k, v) for k, v in constants.items())))
LOG.warning(e)
return HttpResponse(e, status=400)
return HttpResponse("Successfully updated {} to '{}'".format(name, value))
@csrf_exempt @csrf_exempt