1 # Copyright 2016 ZTE Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 logger = logging.getLogger(__name__)
20 def ignore_case_get(args, key, def_val=""):
26 if old_key.upper() == key.upper():
31 def update_value(origin_data, new_data):
32 logger.debug(origin_data)
33 if not isinstance(origin_data, dict):
34 str_data = origin_data.encode('utf-8')
35 logger.debug(str_data)
36 origin_data = eval(str_data)
37 logger.debug(isinstance(origin_data, dict))
38 logger.debug(new_data)
39 for k, v in new_data.iteritems():
40 if k not in origin_data:
43 if isinstance(origin_data[k], list):
44 origin_data[k] = origin_data[k].extend(v)