Xixuan Wu | eefb21a | 2019-03-18 15:15:00 -0700 | [diff] [blame] | 1 | # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Module for ChromeOS build utils without import external packages.""" |
| 6 | |
| 7 | import logging |
| 8 | |
| 9 | |
| 10 | def parse_full_model(full_model): |
| 11 | """Parse full model name to single board and model. |
| 12 | |
| 13 | Args: |
| 14 | full_model: A string, whose format is like 'board_model'. |
| 15 | |
| 16 | Returns: |
| 17 | A tuple (board, model). |
| 18 | """ |
| 19 | model_tokens = full_model.strip().split('_') |
| 20 | try: |
| 21 | return model_tokens[0], model_tokens[1] |
| 22 | except IndexError: |
| 23 | logging.error('Invalid full_model format: %s', full_model) |
| 24 | raise |