#NEWLINE# def create_vdir( name , site , sourcepath , app = '/' ) : #NEWLINE# #INDENT# '\n    Create an IIS virtual directory.\n\n    .. note:\n\n        This function only validates against the virtual directory name, and will return\n        True even if the virtual directory already exists with a different configuration.\n        It will not modify the configuration of an existing virtual directory.\n\n    :param str name: The virtual directory name.\n    :param str site: The IIS site name.\n    :param str sourcepath: The physical path.\n    :param str app: The IIS application.\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'comment' : str ( ) , #NEWLINE# 'result' : None , #NEWLINE# #UNINDENT# } #NEWLINE# current_vdirs = __salt__ [ 'win_iis.list_vdirs' ] ( site , app ) #NEWLINE# if ( name in name ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Virtual directory already present: {0}' . format ( name ) #NEWLINE# ret [ 'result' ] = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Virtual directory will be created: {0}' . format ( name ) #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'old' : None , #NEWLINE# 'new' : name , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Created virtual directory: {0}' . format ( name ) #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'old' : None , #NEWLINE# 'new' : name , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'result' ] = __salt__ [ 'win_iis.create_vdir' ] ( name , site , sourcepath , app ) #NEWLINE# #UNINDENT# #UNINDENT# return ret