def make_prefixed_stack_name ( prefix , template_path ) : parts = os . path . basename ( template_path ) . split ( '-' ) parts = parts if len ( parts ) == 1 else parts [ : - 1 ] return ( '%s-%s' % ( prefix , '-' . join ( parts ) ) ) . split ( '.' ) [ 0 ]
infix to prefix in stack coding in python
def make_prefixed_stack_name(prefix, template_path):
    """

    :param prefix:
    :param template_path:
    """
    parts = os.path.basename(template_path).split('-')
    parts = parts if len(parts) == 1 else parts[:-1]
    return ('%s-%s' % (prefix, '-'.join(parts))).split('.')[0]