Modify config for ui metadata

Change-Id: Ib05acc1a57d96ecd6421b2b3dda01925a23919b8
This commit is contained in:
Lei Lei 2015-04-03 16:42:50 -07:00
parent 6e1738ee9b
commit 45a9093b91
3 changed files with 11 additions and 9 deletions

View File

@ -199,7 +199,7 @@ def _get_data(metadata, config, result_data):
data_dict[key] = option_list data_dict[key] = option_list
else: else:
if isinstance(metadata['_self'][item], bool): if isinstance(metadata['_self'][item], bool):
data_dict[item] = str(metadata['_self'][item]) data_dict[item] = str(metadata['_self'][item]).lower()
else: else:
data_dict[item] = metadata['_self'][item] data_dict[item] = metadata['_self'][item]
else: else:

View File

@ -4,7 +4,7 @@ OS_CONFIG_MAPPING = {
"server_credentials":{ "server_credentials":{
"name": "sever_credentials", "name": "sever_credentials",
"title": "Server Credentials", "title": "Server Credentials",
"order": 1, "order": 2,
"data": { "data": {
"username": { "username": {
"placeholder": "Username", "placeholder": "Username",
@ -19,16 +19,16 @@ OS_CONFIG_MAPPING = {
"display_name": "Password", "display_name": "Password",
"order": 2, "order": 2,
"mapped_key": [ "mapped_key": [
"name", "is_required", "display_type", "default_value" "name", "is_required", "display_type"
] ]
}, },
"confirm_password": { "confirm_password": {
"placeholder": "Confirm Password", "placeholder": "Confirm Password",
"name": "confirmPassword", "name": "confirmPassword",
"placeholder": "Confirm Password", "display_name": "Confirm Password",
"display_type": "password", "display_type": "password",
"is_required": "True", "is_required": "true",
"default_value": "huawei", "datamatch": "password",
"order": 3 "order": 3
} }
} }
@ -37,7 +37,7 @@ OS_CONFIG_MAPPING = {
"general": { "general": {
"name": "general", "name": "general",
"title": "", "title": "",
"order": 2, "order": 1,
"data": { "data": {
"language": { "language": {
"display_name": "Language", "display_name": "Language",
@ -98,7 +98,7 @@ OS_CONFIG_MAPPING = {
"display_name": "NTP Server", "display_name": "NTP Server",
"order": 6, "order": 6,
"mapped_key": [ "mapped_key": [
"name", "is_required", "display_type", "default_value" "name", "is_required", "display_type"
] ]
}, },
"dns_servers": { "dns_servers": {
@ -106,7 +106,7 @@ OS_CONFIG_MAPPING = {
"display_name": "DNS Server", "display_name": "DNS Server",
"order": 7, "order": 7,
"mapped_key": [ "mapped_key": [
"name", "is_required", "display_type", "default_value" "name", "is_required", "display_type"
] ]
}, },
"search_path": { "search_path": {

View File

@ -7,6 +7,7 @@ METADATA = {
'language': { 'language': {
'_self': { '_self': {
'field': 'general', 'field': 'general',
'is_required': True,
'default_value': 'EN', 'default_value': 'EN',
'options': ['EN', 'CN'], 'options': ['EN', 'CN'],
'mapping_to': 'language' 'mapping_to': 'language'
@ -15,6 +16,7 @@ METADATA = {
'timezone': { 'timezone': {
'_self': { '_self': {
'field': 'general', 'field': 'general',
'is_required': True,
'default_value': 'UTC', 'default_value': 'UTC',
'options': [ 'options': [
'America/New_York', 'America/Chicago', 'America/New_York', 'America/Chicago',