#NEWLINE# def _copy_create_ssl_vhost_skeleton( self , avail_fp , ssl_fp ) : #NEWLINE# #INDENT# 'Copies over existing Vhost with IfModule mod_ssl.c> skeleton.\n\n        :param str avail_fp: Pointer to the original available non-ssl vhost\n        :param str ssl_fp: Full path where the new ssl_vhost will reside.\n\n        A new file is created on the filesystem.\n\n        ' #NEWLINE# self . reverter . register_file_creation ( False , ssl_fp ) #NEWLINE# sift = False #NEWLINE# try : #NEWLINE# #INDENT# with open ( ssl_fp , 'r' ) as orig_file : #NEWLINE# #INDENT# with open ( ssl_fp , 'w' ) as new_file : #NEWLINE# #INDENT# new_file . write ( '<IfModule mod_ssl.c>\n' ) #NEWLINE# for line in orig_file : #NEWLINE# #INDENT# if self . _sift_line ( line ) : #NEWLINE# #INDENT# if ( not sift ) : #NEWLINE# #INDENT# new_file . write ( '# Some rewrite rules in this file were were disabled on your HTTPS site,\n# because they have the potential to create redirection loops.\n' ) #NEWLINE# sift = True #NEWLINE# #UNINDENT# new_file . write ( ( '# ' + line ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_file . write ( line ) #NEWLINE# #UNINDENT# #UNINDENT# new_file . write ( '</IfModule>\n' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except IOError : #NEWLINE# #INDENT# logger . fatal ( 'Error writing/reading to file in make_vhost_ssl' ) #NEWLINE# raise errors . PluginError ( 'Unable to write/read in make_vhost_ssl' ) #NEWLINE# #UNINDENT# if sift : #NEWLINE# #INDENT# reporter = zope . component . getUtility ( interfaces . IReporter ) #NEWLINE# reporter . add_message ( 'Some rewrite rules copied from {0} were disabled in the vhost for your HTTPS site located at {1} because they have the potential to create redirection loops.' . format ( avail_fp , ssl_fp ) , reporter . MEDIUM_PRIORITY )