This function will tokenize the string stored in database e.g. database store the value as below key1=value1, key2=value2, key3=value3, .... This function will extract key and value from above string Args: options_from_db: Options from database option_name: Opti
(options_from_db, option_name, option_value)
| 172 | |
| 173 | |
| 174 | def tokenize_options(options_from_db, option_name, option_value): |
| 175 | """ |
| 176 | This function will tokenize the string stored in database |
| 177 | e.g. database store the value as below |
| 178 | key1=value1, key2=value2, key3=value3, .... |
| 179 | This function will extract key and value from above string |
| 180 | |
| 181 | Args: |
| 182 | options_from_db: Options from database |
| 183 | option_name: Option Name |
| 184 | option_value: Option Value |
| 185 | |
| 186 | Returns: |
| 187 | Tokenized options |
| 188 | """ |
| 189 | options = [] |
| 190 | if options_from_db is not None: |
| 191 | for fdw_option in options_from_db: |
| 192 | k, v = fdw_option.split('=', 1) |
| 193 | options.append({option_name: k, option_value: v}) |
| 194 | return options |
| 195 | |
| 196 | |
| 197 | def validate_options(options, option_name, option_value): |
no test coverage detected