blob: b560de44778d82296b3d8dc412682883468ba438 [file] [log] [blame]
Xixuan Wueefb21a2019-03-18 15:15:00 -07001# 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
7import logging
8
9
10def 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