#NEWLINE# def run( self ) : #NEWLINE# #INDENT# target = os . path . join ( self . splunk_home , 'etc' , 'apps' , self . app_name ) #NEWLINE# if os . path . islink ( target ) : #NEWLINE# #INDENT# os . remove ( target ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . exists ( target ) : #NEWLINE# #INDENT# message = 'Cannot create a link at "{}" because a file by that name already exists.' . format ( target ) #NEWLINE# raise SystemError ( message ) #NEWLINE# #UNINDENT# #UNINDENT# packages = os . path . join ( self . app_source , 'bin' , 'packages' ) #NEWLINE# if ( not os . path . isdir ( packages ) ) : #NEWLINE# #INDENT# os . mkdir ( packages ) #NEWLINE# #UNINDENT# splunklib = os . path . join ( packages , 'splunklib' ) #NEWLINE# source = os . path . normpath ( os . path . join ( project_dir , '..' , '..' , 'splunklib' ) ) #NEWLINE# if os . path . islink ( splunklib ) : #NEWLINE# #INDENT# os . remove ( splunklib ) #NEWLINE# #UNINDENT# os . symlink ( source , splunklib ) #NEWLINE# self . _link_debug_client ( ) #NEWLINE# install_packages ( self . app_source , self . distribution ) #NEWLINE# commands_conf = os . path . join ( self . app_source , 'default' , 'commands.conf' ) #NEWLINE# source = os . path . join ( self . app_source , 'default' , 'commands-scpv{}.conf' . format ( self . scp_version ) ) #NEWLINE# if os . path . islink ( splunklib ) : #NEWLINE# #INDENT# os . remove ( commands_conf ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . exists ( commands_conf ) : #NEWLINE# #INDENT# message = 'Cannot create a link at "{}" because a file by that name already exists.' . format ( commands_conf ) #NEWLINE# raise SystemError ( message ) #NEWLINE# #UNINDENT# #UNINDENT# os . symlink ( source , commands_conf ) #NEWLINE# os . symlink ( self . app_source , target ) #NEWLINE# return