Skip to content

Commit 6831d7e

Browse files
author
Cecylia Borek
committed
package app dependencies into bin/
1 parent 92a7da6 commit 6831d7e

File tree

19 files changed

+31
-84
lines changed

19 files changed

+31
-84
lines changed

custom_search_commands/python/customsearchcommands_app/bin/app.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,7 @@ def initialize():
3030
from os import path
3131
from sys import modules, path as python_path
3232

33-
import platform
34-
3533
module_dir = path.dirname(path.realpath(__file__))
36-
system = platform.system()
37-
38-
for packages in path.join(module_dir, 'packages'), path.join(path.join(module_dir, 'packages', system)):
39-
if not path.isdir(packages):
40-
break
41-
python_path.insert(0, path.join(packages))
4234

4335
configuration_file = path.join(module_dir, '_pydebug_conf.py')
4436

custom_search_commands/python/customsearchcommands_app/bin/countmatches.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
# under the License.
1717

1818

19-
import os
2019
import sys
2120

22-
splunkhome = os.environ['SPLUNK_HOME']
23-
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'customsearchcommands_app', 'lib'))
2421
from splunklib.searchcommands import dispatch, StreamingCommand, Configuration, Option, validators
2522

2623
try:

custom_search_commands/python/customsearchcommands_app/bin/filter.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
# under the License.
1717

1818

19-
import os
2019
import sys
2120

22-
splunkhome = os.environ['SPLUNK_HOME']
23-
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'customsearchcommands_app', 'lib'))
2421
from splunklib.searchcommands import dispatch, EventingCommand, Configuration, Option
2522

2623

custom_search_commands/python/customsearchcommands_app/bin/generatehello.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
# under the License.
1717

1818

19-
import os
2019
import sys
2120
import time
2221

23-
splunkhome = os.environ['SPLUNK_HOME']
24-
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'customsearchcommands_app', 'lib'))
2522
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators
2623

2724

custom_search_commands/python/customsearchcommands_app/bin/generatetext.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18-
import os
1918
import sys
2019
import time
2120

22-
splunkhome = os.environ['SPLUNK_HOME']
23-
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'customsearchcommands_app', 'lib'))
2421
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators
2522

2623

custom_search_commands/python/customsearchcommands_app/bin/simulate.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717

1818

1919
import csv
20-
import os
2120
import random
2221
import sys
2322
import time
2423

25-
splunkhome = os.environ['SPLUNK_HOME']
26-
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'customsearchcommands_app', 'lib'))
2724
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators
2825

2926

custom_search_commands/python/customsearchcommands_app/bin/sum.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18-
import os
1918
import sys
2019

21-
splunkhome = os.environ['SPLUNK_HOME']
22-
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'customsearchcommands_app', 'lib'))
2320
from splunklib.searchcommands import dispatch, ReportingCommand, Configuration, Option, validators
2421

2522

custom_search_commands/python/eventingsearchcommands_app/bin/eventingcsc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18-
import os, sys
18+
import sys
1919

20-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib"))
21-
from splunklib.searchcommands import dispatch, EventingCommand, Configuration, Option, validators
20+
from splunklib.searchcommands import dispatch, EventingCommand, Configuration, Option
2221

2322

2423
@Configuration()

custom_search_commands/python/generatingsearchcommands_app/bin/generatingcsc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18-
import os, sys
18+
import sys
1919
import time
2020

21-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib"))
2221
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators
2322

2423

custom_search_commands/python/reportingsearchcommands_app/bin/reportingcsc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18-
import os, sys
18+
import sys
1919

20-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib"))
2120
from splunklib.searchcommands import dispatch, ReportingCommand, Configuration, Option, validators
2221

2322

0 commit comments

Comments
 (0)