diff --git a/src/ApiService/ApiService/onefuzzlib/ProxyOperations.cs b/src/ApiService/ApiService/onefuzzlib/ProxyOperations.cs index 2dab0da5d..a1c813724 100644 --- a/src/ApiService/ApiService/onefuzzlib/ProxyOperations.cs +++ b/src/ApiService/ApiService/onefuzzlib/ProxyOperations.cs @@ -41,7 +41,7 @@ public class ProxyOperations : StatefulOrm, IPr public async Async.Task GetOrCreate(Region region) { { - var proxyList = QueryAsync(filter: TableClient.CreateQueryFilter($"RowKey eq {region.String} and outdated eq false")); + var proxyList = QueryAsync(filter: TableClient.CreateQueryFilter($"PartitionKey eq {region.String} and outdated eq false")); await foreach (var proxy in proxyList) { if (IsOutdated(proxy)) { var r1 = await Replace(proxy with { Outdated = true }); diff --git a/src/cli/onefuzz/api.py b/src/cli/onefuzz/api.py index 04eb3f3d5..4fc2753a2 100644 --- a/src/cli/onefuzz/api.py +++ b/src/cli/onefuzz/api.py @@ -123,7 +123,6 @@ class Endpoint: as_params: bool = False, alternate_endpoint: Optional[str] = None, ) -> A: - # Retrieve Auth Parameters self._req_config_params() @@ -161,7 +160,6 @@ class Endpoint: def _req_config_params( self, ) -> None: - if self.onefuzz._backend.config.endpoint is None: raise Exception("Endpoint Not Configured") @@ -529,7 +527,6 @@ class Containers(Endpoint): def _download_tasks( self, tasks: List[models.Task], output: Optional[primitives.Directory] ) -> None: - to_download: Dict[str, str] = {} for task in tasks: for container in task.config.containers: @@ -611,7 +608,6 @@ class Repro(Endpoint): with build_ssh_command( repro.ip, repro.auth.private_key, command="-T" ) as ssh_cmd: - gdb_script = [ "target remote | %s sudo /onefuzz/bin/repro-stdout.sh" % " ".join(ssh_cmd) @@ -1006,7 +1002,7 @@ class Tasks(Endpoint): tags = {} containers_submit = [] - for (container_type, container) in containers: + for container_type, container in containers: containers_submit.append( models.TaskContainers(name=container, type=container_type) ) @@ -1208,7 +1204,6 @@ class Jobs(Endpoint): self.tasks = JobTasks(onefuzz) def delete(self, job_id: UUID_EXPANSION) -> models.Job: - """Stop a job and all tasks that make up a job""" job_id_expanded = self._disambiguate_uuid( "job_id", job_id, lambda: [str(x.job_id) for x in self.list()] @@ -1834,7 +1829,6 @@ class Onefuzz: authority: Optional[str] = None, tenant_domain: Optional[str] = None, ) -> None: - if endpoint: self._backend.config.endpoint = endpoint if authority is not None: diff --git a/src/cli/onefuzz/cli.py b/src/cli/onefuzz/cli.py index df2afc880..4456f52d4 100644 --- a/src/cli/onefuzz/cli.py +++ b/src/cli/onefuzz/cli.py @@ -429,7 +429,7 @@ class Builder: self, inst: Callable, subparser: argparse._SubParsersAction ) -> None: """Expose every non-private callable in a class instance""" - for (name, func) in self.get_children(inst, is_callable=True): + for name, func in self.get_children(inst, is_callable=True): sub = subparser.add_parser(name, help=self.get_help(func)) add_base(sub) self.parse_function(func, sub) @@ -442,7 +442,7 @@ class Builder: title="subcommands", dest="level_%d" % level ) - for (name, endpoint) in self.get_children(inst, is_typed=True): + for name, endpoint in self.get_children(inst, is_typed=True): parser = subparser.add_parser( name, help=self.get_help(endpoint), parents=[self.top_level] ) @@ -451,7 +451,7 @@ class Builder: title="subcommands", dest="level_%d" % (level + 1) ) - for (nested_name, nested_endpoint) in self.get_children( + for nested_name, nested_endpoint in self.get_children( endpoint, is_typed=True ): nested = method_subparser.add_parser( diff --git a/src/cli/onefuzz/debug.py b/src/cli/onefuzz/debug.py index 29ade1008..f62c0d3ba 100644 --- a/src/cli/onefuzz/debug.py +++ b/src/cli/onefuzz/debug.py @@ -462,7 +462,6 @@ class DebugLog(Command): if self._app_id is None: raise Exception("instance does not have an insights_appid") if self._client is None: - creds = AzureIdentityCredentialAdapter( AzureCliCredential(), resource_id="https://api.applicationinsights.io" ) diff --git a/src/cli/onefuzz/job_templates/handlers.py b/src/cli/onefuzz/job_templates/handlers.py index f1bee92c3..cdbf2c0e1 100644 --- a/src/cli/onefuzz/job_templates/handlers.py +++ b/src/cli/onefuzz/job_templates/handlers.py @@ -61,7 +61,6 @@ class TemplateSubmitHandler(Endpoint): def _define_missing_containers( self, config: JobTemplateConfig, request: JobTemplateRequest ) -> None: - for container_type in config.containers: seen = False for container in request.containers: diff --git a/src/cli/onefuzz/status/top_view.py b/src/cli/onefuzz/status/top_view.py index d6774dff0..0216c9e6b 100644 --- a/src/cli/onefuzz/status/top_view.py +++ b/src/cli/onefuzz/status/top_view.py @@ -47,7 +47,6 @@ def column_config(fields: Optional[List[str]]) -> List[Union[int, str]]: class TopView(Frame): def __init__(self, screen: Any, cache: TopCache): - super(TopView, self).__init__( screen, screen.height, screen.width, has_border=True, can_scroll=False ) @@ -144,7 +143,6 @@ class TopView(Frame): """recompute widget width based on max length of all of the values""" widget = self.find_widget(name) for column in range(len(widget._columns) - 1): - sizes = [len(x[0][column]) + 1 for x in widget.options] if widget._titles: sizes.append(len(widget._titles[column]) + 1) diff --git a/src/cli/onefuzz/templates/__init__.py b/src/cli/onefuzz/templates/__init__.py index 2c9e3a792..8690b50e0 100644 --- a/src/cli/onefuzz/templates/__init__.py +++ b/src/cli/onefuzz/templates/__init__.py @@ -97,7 +97,7 @@ class JobHelper: ) def create_containers(self) -> None: - for (container_type, container_name) in self.containers.items(): + for container_type, container_name in self.containers.items(): self.logger.info("using container: %s", container_name) self.onefuzz.containers.create( container_name, metadata={"container_type": container_type.name} diff --git a/src/cli/onefuzz/templates/libfuzzer.py b/src/cli/onefuzz/templates/libfuzzer.py index 7225e3c2d..de423b4f3 100644 --- a/src/cli/onefuzz/templates/libfuzzer.py +++ b/src/cli/onefuzz/templates/libfuzzer.py @@ -466,7 +466,6 @@ class Libfuzzer(Command): preserve_existing_outputs: bool = False, check_fuzzer_help: bool = True, ) -> Optional[Job]: - """ libfuzzer merge task """ @@ -585,7 +584,6 @@ class Libfuzzer(Command): check_fuzzer_help: bool = True, expect_crash_on_failure: bool = False, ) -> Optional[Job]: - """ libfuzzer-dotnet task """ @@ -910,7 +908,6 @@ class Libfuzzer(Command): check_retry_count: Optional[int] = 300, check_fuzzer_help: bool = True, ) -> Optional[Job]: - """ libfuzzer tasks, wrapped via qemu-user (PREVIEW FEATURE) """ diff --git a/src/cli/onefuzz/templates/regression.py b/src/cli/onefuzz/templates/regression.py index 0f931956c..e2ecce781 100644 --- a/src/cli/onefuzz/templates/regression.py +++ b/src/cli/onefuzz/templates/regression.py @@ -116,7 +116,6 @@ class Regression(Command): delete_input_container: bool = True, check_regressions: bool = False, ) -> None: - """ libfuzzer regression task @@ -177,7 +176,6 @@ class Regression(Command): delete_input_container: bool = True, check_regressions: bool = False, ) -> None: - if dryrun: return None diff --git a/src/cli/tests/test_template_helper.py b/src/cli/tests/test_template_helper.py index d486989e3..69c100225 100644 --- a/src/cli/tests/test_template_helper.py +++ b/src/cli/tests/test_template_helper.py @@ -62,7 +62,7 @@ class TestHelper(unittest.TestCase): values[(filename, Directory("c:\\unused\\"))] = expected values[(filename, Directory("c:\\unused\\"))] = expected - for (args, expected) in values.items(): + for args, expected in values.items(): self.assertEqual(helper.setup_relative_blob_name(*args), expected) with self.assertRaises(ValueError): diff --git a/src/deployment/deploy.py b/src/deployment/deploy.py index 23d06a424..c1a5b5c87 100644 --- a/src/deployment/deploy.py +++ b/src/deployment/deploy.py @@ -631,7 +631,6 @@ class Client: # Add --custom_domain value to Allowed token audiences setting if self.custom_domain: - if self.multi_tenant_domain != "": root_domain = self.multi_tenant_domain else: @@ -776,7 +775,6 @@ class Client: logger.info("parsing config: %s", self.config) if self.config: - with open(self.config, "r") as template_handle: config_template = json.load(template_handle) diff --git a/src/deployment/deploylib/configuration.py b/src/deployment/deploylib/configuration.py index 4c56ee7fe..df77fe459 100644 --- a/src/deployment/deploylib/configuration.py +++ b/src/deployment/deploylib/configuration.py @@ -113,7 +113,6 @@ class Config: self.allowed_service_tags = proxy_config["allowed_service_tags"] def parse_endpoint_json(self, config: Any) -> None: - if "cli_client_id" not in config: raise Exception( "CLI client_id not provided as valid key. Please Provide Valid Config." @@ -241,7 +240,6 @@ def update_admins(config_client: InstanceConfigClient, admins: List[UUID]) -> No def parse_rules(proxy_config: Config) -> List[NsgRule]: - allowed_ips = proxy_config.allowed_ips allowed_service_tags = proxy_config.allowed_service_tags diff --git a/src/deployment/deploylib/registration.py b/src/deployment/deploylib/registration.py index e5c5a42b2..68caed958 100644 --- a/src/deployment/deploylib/registration.py +++ b/src/deployment/deploylib/registration.py @@ -382,7 +382,6 @@ def add_application_password( def add_application_password_impl( password_name: str, app_object_id: UUID, subscription_id: str ) -> Tuple[str, str]: - app = query_microsoft_graph( method="GET", resource="applications/%s" % app_object_id, diff --git a/src/pytypes/onefuzztypes/events.py b/src/pytypes/onefuzztypes/events.py index 938666514..163801629 100644 --- a/src/pytypes/onefuzztypes/events.py +++ b/src/pytypes/onefuzztypes/events.py @@ -305,8 +305,7 @@ EventTypeMap = { def get_event_type(event: Event) -> EventType: - - for (event_type, event_class) in EventTypeMap.items(): + for event_type, event_class in EventTypeMap.items(): if isinstance(event, event_class): return event_type diff --git a/src/utils/check-pr/check-pr.py b/src/utils/check-pr/check-pr.py index acc030bf2..ff79e2fa6 100755 --- a/src/utils/check-pr/check-pr.py +++ b/src/utils/check-pr/check-pr.py @@ -84,7 +84,7 @@ class Deployer: ), ), ] - for (msg, cmd) in commands: + for msg, cmd in commands: print(msg) subprocess.check_call(cmd, shell=True) @@ -115,7 +115,7 @@ class Deployer: ), ] - for (msg, cmd) in commands: + for msg, cmd in commands: print(msg) output = subprocess.check_output(cmd, shell=True, encoding="UTF-8") if "client_id" in output: @@ -166,7 +166,7 @@ class Deployer: ), ), ] - for (msg, cmd) in commands: + for msg, cmd in commands: print(msg) print(cmd) subprocess.check_call(cmd, shell=True) diff --git a/src/utils/check-pr/cleanup_ad.py b/src/utils/check-pr/cleanup_ad.py index ad9e3c170..8197aee84 100644 --- a/src/utils/check-pr/cleanup_ad.py +++ b/src/utils/check-pr/cleanup_ad.py @@ -55,7 +55,7 @@ def delete_current_user_app_registrations(contains: str) -> None: ): my_apps.append((x["displayName"], x["id"])) - for (name, id) in my_apps: + for name, id in my_apps: print("Deleting: %s (%s)" % (name, id)) result = client.delete(f"/applications/{id}") if not result.ok: diff --git a/src/utils/check-pr/github_client.py b/src/utils/check-pr/github_client.py index cf210d10a..26107237b 100644 --- a/src/utils/check-pr/github_client.py +++ b/src/utils/check-pr/github_client.py @@ -172,7 +172,6 @@ def download_artifacts( def main() -> None: - parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group() group.add_argument("--branch")