Exemplo n.º 1
0
def parse_osd_uuid(string):
    osd_id = '%s-' % parse_osd_id(string)
    osd_subcommand = '-%s' % parse_subcommand(string)
    # remove the id first
    trimmed_suffix = string.split(osd_id)[-1]
    # now remove the sub command
    osd_uuid = trimmed_suffix.split(osd_subcommand)[0]
    if not osd_uuid:
        raise SuffixParsingError('OSD uuid', string)
    return osd_uuid
Exemplo n.º 2
0
def parse_subcommand(string):
    subcommand = string.split('-', 1)[0]
    if not subcommand:
        raise SuffixParsingError('subcommand', string)
    return subcommand