def reindex(): """ For docs, see https://github.com/pkimber/cloud_docs """ env.user = '******' print(green("Haystack - reindex: '{}' on '{}' ").format( env.site_name, env.hosts )) folder_info = FolderInfo(env.site_info) command = DjangoCommand( folder_info.live(), folder_info.live_venv(), env.site_info ) command.haystack_index()
def haystack_index_clear(prefix, name): """ e.g: fab -H [email protected] haystack_index:prefix=pkimber,name=csw_web """ print(green("Haystack - reindex: '{}' on '{}' ").format( name, env.host_string) ) confirm = '' while confirm not in ('Y', 'N'): confirm = prompt("Are you sure you want to clear the Haystack index (Y/N)?") confirm = confirm.strip().upper() if not confirm == 'Y': abort("exit") folder_info = FolderInfo(name) command = DjangoCommand( folder_info.live(), folder_info.live_venv(), env.site_info ) command.haystack_index_clear()