'Validate the snippet\'s relative file path.
@param: str snippet automatic installation snippet relative file path
@param: bool new_snippet (when set to true new filenames are allowed)
@returns: str snippet or CX'

def validate_autoinstall_snippet_file_path(self, snippet, new_snippet=False):

    if (not isinstance(snippet, basestring)):
        raise CX('Invalid    input,    snippet    must    be    a    string')
    else:
        snippet = snippet.strip()
    if (snippet.find('..') != (-1)):
        raise CX(('Invalid    automated    installation    snippet    file    location    %s,    it    must    not    contain    ..' % snippet))
    snippet_path = ('%s/%s' % (self.snippets_base_dir, snippet))
    if ((not os.path.isfile(snippet_path)) and (not new_snippet)):
        raise CX(('Invalid    automated    installation    snippet    file    location    %s,    file    not    found' % snippet_path))
    return snippet
