Skip to content

Commit

Permalink
fix: delete unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ikheifets-splunk committed Aug 28, 2023
1 parent 8d4e05f commit 9d0b275
Show file tree
Hide file tree
Showing 126 changed files with 750 additions and 756 deletions.
2 changes: 1 addition & 1 deletion docs/resources/test_vmware_carbonblack_with_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_vmware_carbonblack_protect(
)
search = st.render(epoch=epoch, bsd=bsd, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_a10.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_a10_vthunder(
"{{ mark }} CEF:0|A10|vThunder|4.1.4-GR1-P12|WAF|session-id|2|rt={{ bsd }} src=1.1.1.1 spt=34860 dst=1.1.1.1 dpt=80 dhost=test.host.local cs1=uiext_sec_waf cs2=1 act=learn cs3=learn app=HTTP requestMethod=GET cn1=0 request=/sales/ msg=New session created: Id\=1\n"
)
dt = datetime.datetime.now(datetime.timezone.utc)
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, _, _, _, _, _, epoch = time_operations(dt)
message = mt.render(mark="<6>", bsd=dt.strftime("%b %d %Y %H:%M:%S"))

# Tune time functions
Expand All @@ -33,7 +33,7 @@ def test_a10_vthunder(
)
search = st.render(epoch=epoch)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("resultCount", result_count)
record_property("message", message)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_airwatch_rfc3164.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_airwatch(
host = "" + get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, date, _, _, epoch = time_operations(dt)
bsd_airwatch = dt.strftime("%B %d, %Y %H:%M:%S")

# Tune time functions
Expand All @@ -48,7 +48,7 @@ def test_airwatch(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_alcatel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_alcatel(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -44,7 +44,7 @@ def test_alcatel(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_alsid.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_alsid(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -44,7 +44,7 @@ def test_alsid(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_arista.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
def test_arista_switch(record_property, setup_splunk, setup_sc4s, event):
# Get UTC-based 'dt' time structure
dt = datetime.datetime.now(datetime.timezone.utc)
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
iso, _, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
# iso from included timeutils is from local timezone; need to keep iso as UTC
Expand All @@ -51,7 +51,7 @@ def test_arista_switch(record_property, setup_splunk, setup_sc4s, event):
)
search = st.render(epoch=epoch, program=event["program"].lower())

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("resultCount", result_count)
record_property("message", message)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_aruba.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_aruba(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)
arubadate = dt.strftime("%b %d %H:%M:%S %Y")

# Tune time functions
Expand All @@ -52,7 +52,7 @@ def test_aruba(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_aruba_clearpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_aruba_clearpass_CPPM(
host = "aruba-cp-" + get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, date, _, _, epoch = time_operations(dt)

aruba_time = dt.strftime("%Y-%m-%d %H:%M:%S,%f")[:-3]
epoch = epoch[:-3]
Expand All @@ -50,7 +50,7 @@ def test_aruba_clearpass_CPPM(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_avaya.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_avaya_sip(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -47,7 +47,7 @@ def test_avaya_sip(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
16 changes: 8 additions & 8 deletions tests/test_avi_vantage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_avi_event_rfc(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, date, _, _, epoch = time_operations(dt)
avi_time = dt.strftime("%H:%M:%S,%f")[:-3]

epoch = epoch[:-3]
Expand All @@ -52,7 +52,7 @@ def test_avi_event_rfc(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand All @@ -68,7 +68,7 @@ def test_avi_event_JSON(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, date, _, _, epoch = time_operations(dt)

avi_time = dt.strftime("%H:%M:%S,%f")[:-3]
epoch = epoch[:-3]
Expand All @@ -83,7 +83,7 @@ def test_avi_event_JSON(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand All @@ -99,7 +99,7 @@ def test_avi_event_no_host(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, date, _, _, epoch = time_operations(dt)

avi_time = dt.strftime("%H:%M:%S,%f")[:-3]
epoch = epoch[:-3]
Expand All @@ -114,7 +114,7 @@ def test_avi_event_no_host(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("resultCount", result_count)
record_property("message", message)
Expand All @@ -129,7 +129,7 @@ def test_avi_event_rfc5424(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
iso, _, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-3]
Expand All @@ -141,7 +141,7 @@ def test_avi_event_rfc5424(
st = env.from_string('search _time={{ epoch }} index=netops sourcetype="avi:logs"')
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_barracuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_barracuda(record_property, setup_splunk, setup_sc4s):
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
iso, bsd, time, date, tzoffset, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-3]
Expand All @@ -36,7 +36,7 @@ def test_barracuda(record_property, setup_splunk, setup_sc4s):
epoch=epoch, bsd=bsd, host=host, date=date, time=time, tzoffset=tzoffset
)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_barracuda_waf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_barracuda_waf(
)
search = st.render(index=test_case["index"], epoch=epoch, source_type=test_case["sourcetype"], host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_beyondtrust.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_beyondtrust_sra(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -44,7 +44,7 @@ def test_beyondtrust_sra(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand All @@ -59,7 +59,7 @@ def test_beyondtrust_parts(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -79,7 +79,7 @@ def test_beyondtrust_parts(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_broadcom_sslva.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_sslva(
host = get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -47,7 +47,7 @@ def test_sslva(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_brocade.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_brocade(
host = "test_brocade-" + get_host_key

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
_, bsd, _, _, _, _, epoch = time_operations(dt)

# Tune time functions
epoch = epoch[:-7]
Expand All @@ -49,7 +49,7 @@ def test_brocade(
)
search = st.render(epoch=epoch, host=host)

result_count, event_count = splunk_single(setup_splunk, search)
result_count, _ = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", result_count)
Expand Down
Loading

0 comments on commit 9d0b275

Please sign in to comment.