def GetFactoryName(board, factory, alt_naming=0): """Determines release page URL and naming pattern of desired factory image. Args: board: target board factory: factory version and channel alt_naming: optional, see docstring for GetNameComponents. Returns: fac_url: a string, the release page URL token_list: a list of strings, in the order they are expected in the url. """ fac_no, fac_ch = factory.split('/') fac_ch = fac_ch + '-channel' if alt_naming == 1: fac_url = os.path.join(IMAGE_SERVER_PREFIX, fac_ch, board + '-rc', fac_no) elif alt_naming == 2: fac_url = os.path.join( IMAGE_SERVER_PREFIX.replace('chromeos-official', ''), fac_ch, board, fac_no) elif alt_naming == 3: fac_url = os.path.join(IMAGE_GSD_PREFIX, fac_ch, board, fac_no) else: fac_url = os.path.join(IMAGE_SERVER_PREFIX, fac_ch, board, fac_no) token_list = ['chromeos-factory', fac_no, board, '.zip'] return (fac_url, token_list)
def GetNameComponents(board, version_string, alt_naming): """Determine URL and version components of script input. If you update alt_naming values below, remember to update constant NUM_NAMING_SCHEME above. Args: board: target board version_string: string with image version information alt_naming: try alternative build naming 0 - default naming scheme for images hosted on chromeos-images/ 1 - append '-rc' to board for index html page and links 2 - remove chromeos-official for index html page and links 3 - default naming scheme for images hosted on GSD Returns: url, a string, the image index page URL num, a string, the image version number cha, a string, the image channel key, a string, part of the image signing key label """ num, cha, key = version_string.split('/') cha = cha + '-channel' if alt_naming == 1: url = os.path.join(IMAGE_SERVER_PREFIX, cha, board + '-rc', num) elif alt_naming == 2: url = os.path.join( IMAGE_SERVER_PREFIX.replace('chromeos-official', ''), cha, board, num) elif alt_naming == 3: url = os.path.join(IMAGE_GSD_PREFIX, cha, board, num) else: url = os.path.join(IMAGE_SERVER_PREFIX, cha, board, num) return (url, num, cha, key)
def GetFactoryName(board, factory, alt_naming=0): """Determines release page URL and naming pattern of desired factory image. Args: board: target board factory: factory version and channel alt_naming: optional, see docstring for GetNameComponents. Returns: fac_url: a string, the release page URL token_list: a list of strings, in the order they are expected in the url. """ fac_no, fac_ch = factory.split('/') fac_ch = fac_ch + '-channel' if alt_naming == 1: fac_url = os.path.join(IMAGE_SERVER_PREFIX, fac_ch, board + '-rc', fac_no) elif alt_naming == 2: fac_url = os.path.join(IMAGE_SERVER_PREFIX.replace('chromeos-official', ''), fac_ch, board, fac_no) elif alt_naming == 3: fac_url = os.path.join(IMAGE_GSD_PREFIX, fac_ch, board, fac_no) else: fac_url = os.path.join(IMAGE_SERVER_PREFIX, fac_ch, board, fac_no) token_list = ['chromeos-factory', fac_no, board, '.zip'] return (fac_url, token_list)