Skip to content

Commit aaac5e2

Browse files
committed
Ruff lint autofixes
1 parent 3335e48 commit aaac5e2

30 files changed

+24
-56
lines changed

contentctl/actions/build.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import sys
21
import shutil
3-
import os
42

53
from dataclasses import dataclass
64

7-
from contentctl.objects.enums import SecurityContentType
8-
from contentctl.input.director import Director, DirectorOutputDto
5+
from contentctl.input.director import DirectorOutputDto
96
from contentctl.output.conf_output import ConfOutput
107
from contentctl.output.conf_writer import ConfWriter
118
from contentctl.output.api_json_output import ApiJsonOutput

contentctl/actions/deploy_acs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def execute(self, config: deploy_acs, appinspect_token:str) -> None:
4242
# This likely includes a more verbose response describing the error
4343
res.raise_for_status()
4444
print(res.json())
45-
except Exception as e:
45+
except Exception:
4646
try:
4747
error_text = res.json()
48-
except Exception as e:
48+
except Exception:
4949
error_text = "No error text - request failed"
5050
formatted_error_text = pprint.pformat(error_text)
5151
print("While this may not be the cause of your error, ensure that the uid and appid of your Private App does not exist in Splunkbase\n"

contentctl/actions/detection_testing/DetectionTestingManager.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructure import DetectionTestingInfrastructure
44
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructureContainer import DetectionTestingInfrastructureContainer
55
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructureServer import DetectionTestingInfrastructureServer
6-
from urllib.parse import urlparse
7-
from copy import deepcopy
86
import signal
97
import datetime
108
# from queue import Queue
119
from dataclasses import dataclass
1210
# import threading
13-
import ctypes
1411
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructure import (
15-
DetectionTestingInfrastructure,
1612
DetectionTestingManagerOutputDto,
1713
)
1814
from contentctl.actions.detection_testing.views.DetectionTestingView import (
1915
DetectionTestingView,
2016
)
2117
from contentctl.objects.enums import PostTestBehavior
22-
from pydantic import BaseModel, Field
18+
from pydantic import BaseModel
2319
from contentctl.objects.detection import Detection
2420
import concurrent.futures
2521
import docker
@@ -133,7 +129,7 @@ def create_DetectionTestingInfrastructureObjects(self):
133129
if (isinstance(self.input_dto.config, test) and isinstance(infrastructure, Container)):
134130
try:
135131
client = docker.from_env()
136-
except Exception as e:
132+
except Exception:
137133
raise Exception("Unable to connect to docker. Are you sure that docker is running on this host?")
138134
try:
139135

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructureContainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def removeContainer(self, removeVolumes: bool = True, forceRemove: bool = True):
141141
container: docker.models.containers.Container = (
142142
self.get_docker_client().containers.get(self.get_name())
143143
)
144-
except Exception as e:
144+
except Exception:
145145
# Container does not exist, no need to try and remove it
146146
return
147147
try:

contentctl/actions/detection_testing/views/DetectionTestingViewCLI.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
)
44

55
import time
6-
import datetime
76
import tqdm
87

98

contentctl/actions/initialize_old.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
import sys
88
import questionary
99
import os
10-
from contentctl.objects.enums import LogLevel
1110

12-
import abc
13-
from pydantic import BaseModel, Field
1411

15-
from contentctl.objects.config import Config
1612

1713
DEFAULT_FOLDERS = ['detections', 'stories', 'lookups', 'macros', 'baselines', 'dist']
1814

contentctl/actions/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def inspectAppCLI(self, config: inspect) -> None:
150150
from splunk_appinspect.main import (
151151
validate, MODE_OPTION, APP_PACKAGE_ARGUMENT, OUTPUT_FILE_OPTION,
152152
LOG_FILE_OPTION, INCLUDED_TAGS_OPTION, EXCLUDED_TAGS_OPTION,
153-
PRECERT_MODE, TEST_MODE)
153+
TEST_MODE)
154154
except Exception as e:
155155
print(e)
156156
# print("******WARNING******")

contentctl/actions/new_content.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from dataclasses import dataclass
21
import questionary
32
from typing import Any
43
from contentctl.input.new_content_questions import NewContentQuestions

contentctl/actions/release_notes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from contentctl.objects.config import release_notes
32
from git import Repo
43
import re
@@ -54,7 +53,7 @@ def create_notes(self,repo_path:pathlib.Path, file_paths:List[pathlib.Path], hea
5453

5554

5655
# Check and create detection link
57-
if 'name' in data and 'id' in data and 'detections' in file_path.parts and not 'ssa_detections' in file_path.parts and 'detections/deprecated' not in file_path.parts:
56+
if 'name' in data and 'id' in data and 'detections' in file_path.parts and 'ssa_detections' not in file_path.parts and 'detections/deprecated' not in file_path.parts:
5857

5958
if data['status'] == "production":
6059
temp_link = "https://research.splunk.com" + str(file_path).replace(str(repo_path),"")
@@ -232,9 +231,9 @@ def printNotes(notes:List[dict[str,Union[List[str], str]]], outfile:Union[pathli
232231
with open(outfile,'w') as writer:
233232
writer.write(text_blob)
234233

235-
printNotes(notes, config.releaseNotesFilename(f"release_notes.txt"))
234+
printNotes(notes, config.releaseNotesFilename("release_notes.txt"))
236235

237236
print("\n\n### Other Updates\n-\n")
238237
print("\n## BA Release Notes")
239238
printNotes(ba_notes, config.releaseNotesFilename("ba_release_notes.txt"))
240-
print(f"Release notes completed succesfully")
239+
print("Release notes completed succesfully")

contentctl/actions/reporting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21

32
from dataclasses import dataclass
43

0 commit comments

Comments
 (0)