'Validate the automatic installation template\'s relative file path.
@param: str autoinstall automatic installation template relative file path
@param: bool for_item (enable/disable special handling for Item objects)
@param: bool new_autoinstall (when set to true new filenames are allowed)
@returns str automatic installation template relative file path'

def validate_autoinstall_template_file_path(self, autoinstall, for_item=True, new_autoinstall=False):

    if (not isinstance(autoinstall, basestring)):
        raise CX('Invalid    input,    autoinstall    must    be    a    string')
    else:
        autoinstall = autoinstall.strip()
    if (autoinstall == ''):
        return autoinstall
    if (for_item is True):
        if (autoinstall == '<<inherit>>'):
            return autoinstall
    if (autoinstall.find('..') != (-1)):
        raise CX(('Invalid    automatic    installation    template    file    location    %s,    it    must    not    contain    ..' % autoinstall))
    autoinstall_path = ('%s/%s' % (self.templates_base_dir, autoinstall))
    if ((not os.path.isfile(autoinstall_path)) and (not new_autoinstall)):
        raise CX(('Invalid    automatic    installation    template    file    location    %s,    file    not    found' % autoinstall_path))
    return autoinstall
