From f5785976be4fa163ced829ba481ae01c5b21987f Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Wed, 1 Feb 2023 14:59:38 -0500 Subject: Update to comply with new black rules --- awxkit/awxkit/api/client.py | 1 - awxkit/awxkit/api/mixins/has_create.py | 1 - awxkit/awxkit/api/mixins/has_status.py | 1 - awxkit/awxkit/api/pages/access_list.py | 1 - awxkit/awxkit/api/pages/activity_stream.py | 2 -- awxkit/awxkit/api/pages/ad_hoc_commands.py | 4 ---- awxkit/awxkit/api/pages/api.py | 2 -- awxkit/awxkit/api/pages/applications.py | 2 -- awxkit/awxkit/api/pages/authtoken.py | 1 - awxkit/awxkit/api/pages/credential_input_sources.py | 2 -- awxkit/awxkit/api/pages/credentials.py | 5 ----- awxkit/awxkit/api/pages/dashboard.py | 1 - awxkit/awxkit/api/pages/execution_environments.py | 1 - awxkit/awxkit/api/pages/instance_groups.py | 1 - awxkit/awxkit/api/pages/instances.py | 2 -- awxkit/awxkit/api/pages/inventory.py | 16 ---------------- awxkit/awxkit/api/pages/job_templates.py | 5 ----- awxkit/awxkit/api/pages/jobs.py | 12 ------------ awxkit/awxkit/api/pages/labels.py | 2 -- awxkit/awxkit/api/pages/mesh_visualizer.py | 1 - awxkit/awxkit/api/pages/notification_templates.py | 6 +----- awxkit/awxkit/api/pages/organizations.py | 2 -- awxkit/awxkit/api/pages/page.py | 3 --- awxkit/awxkit/api/pages/ping.py | 1 - awxkit/awxkit/api/pages/projects.py | 8 -------- awxkit/awxkit/api/pages/roles.py | 2 -- awxkit/awxkit/api/pages/schedules.py | 1 - awxkit/awxkit/api/pages/settings.py | 1 - awxkit/awxkit/api/pages/system_job_templates.py | 1 - awxkit/awxkit/api/pages/system_jobs.py | 3 --- awxkit/awxkit/api/pages/teams.py | 2 -- awxkit/awxkit/api/pages/unified_job_templates.py | 1 - awxkit/awxkit/api/pages/unified_jobs.py | 1 - awxkit/awxkit/api/pages/users.py | 3 --- awxkit/awxkit/api/pages/workflow_approval_templates.py | 2 -- awxkit/awxkit/api/pages/workflow_approvals.py | 1 - awxkit/awxkit/api/pages/workflow_job_nodes.py | 1 - awxkit/awxkit/api/pages/workflow_job_template_nodes.py | 2 -- awxkit/awxkit/api/pages/workflow_job_templates.py | 4 ---- awxkit/awxkit/api/pages/workflow_jobs.py | 1 - awxkit/awxkit/api/resources.py | 1 - awxkit/awxkit/cli/custom.py | 8 -------- awxkit/awxkit/cli/options.py | 1 - awxkit/awxkit/exceptions.py | 18 ------------------ awxkit/awxkit/utils/__init__.py | 2 +- awxkit/awxkit/ws.py | 1 - awxkit/test/test_dependency_resolver.py | 17 ----------------- awxkit/test/test_registry.py | 2 -- 48 files changed, 2 insertions(+), 157 deletions(-) (limited to 'awxkit') diff --git a/awxkit/awxkit/api/client.py b/awxkit/awxkit/api/client.py index 04b399e079..95e990b792 100644 --- a/awxkit/awxkit/api/client.py +++ b/awxkit/awxkit/api/client.py @@ -10,7 +10,6 @@ log = logging.getLogger(__name__) class ConnectionException(exc.Common): - pass diff --git a/awxkit/awxkit/api/mixins/has_create.py b/awxkit/awxkit/api/mixins/has_create.py index 1e8b24db5a..21f37fe7a2 100644 --- a/awxkit/awxkit/api/mixins/has_create.py +++ b/awxkit/awxkit/api/mixins/has_create.py @@ -201,7 +201,6 @@ except ImportError: class HasCreate(object): - # For reference only. Use self.ds, or self._dependency_store if mutating. dependencies = [] optional_dependencies = [] diff --git a/awxkit/awxkit/api/mixins/has_status.py b/awxkit/awxkit/api/mixins/has_status.py index d4453d302a..0bb9992f69 100644 --- a/awxkit/awxkit/api/mixins/has_status.py +++ b/awxkit/awxkit/api/mixins/has_status.py @@ -13,7 +13,6 @@ def bytes_to_str(obj): class HasStatus(object): - completed_statuses = ['successful', 'failed', 'error', 'canceled'] started_statuses = ['pending', 'running'] + completed_statuses diff --git a/awxkit/awxkit/api/pages/access_list.py b/awxkit/awxkit/api/pages/access_list.py index f037fcfa72..c028bea087 100644 --- a/awxkit/awxkit/api/pages/access_list.py +++ b/awxkit/awxkit/api/pages/access_list.py @@ -4,7 +4,6 @@ from . import page class AccessList(page.PageList, users.User): - pass diff --git a/awxkit/awxkit/api/pages/activity_stream.py b/awxkit/awxkit/api/pages/activity_stream.py index 0be25e47c9..692136c1ce 100644 --- a/awxkit/awxkit/api/pages/activity_stream.py +++ b/awxkit/awxkit/api/pages/activity_stream.py @@ -4,7 +4,6 @@ from . import page class ActivityStream(base.Base): - pass @@ -12,7 +11,6 @@ page.register_page(resources.activity, ActivityStream) class ActivityStreams(page.PageList, ActivityStream): - pass diff --git a/awxkit/awxkit/api/pages/ad_hoc_commands.py b/awxkit/awxkit/api/pages/ad_hoc_commands.py index 39b11d8746..92dc34c523 100644 --- a/awxkit/awxkit/api/pages/ad_hoc_commands.py +++ b/awxkit/awxkit/api/pages/ad_hoc_commands.py @@ -9,7 +9,6 @@ from . import page class AdHocCommand(HasCreate, UnifiedJob): - dependencies = [Inventory, Credential] def relaunch(self, payload={}): @@ -30,7 +29,6 @@ class AdHocCommand(HasCreate, UnifiedJob): return update_payload(payload, optional_fields, kwargs) def create_payload(self, module_name='ping', module_args=np, job_type=np, limit=np, verbosity=np, inventory=Inventory, credential=Credential, **kwargs): - self.create_and_update_dependencies(inventory, credential) payload = self.payload( @@ -47,7 +45,6 @@ class AdHocCommand(HasCreate, UnifiedJob): return payload def create(self, module_name='ping', module_args=np, job_type=np, limit=np, verbosity=np, inventory=Inventory, credential=Credential, **kwargs): - payload = self.create_payload( module_name=module_name, module_args=module_args, @@ -65,7 +62,6 @@ page.register_page([resources.ad_hoc_command], AdHocCommand) class AdHocCommands(page.PageList, AdHocCommand): - pass diff --git a/awxkit/awxkit/api/pages/api.py b/awxkit/awxkit/api/pages/api.py index 21ea8afbb7..f1f9b6712a 100644 --- a/awxkit/awxkit/api/pages/api.py +++ b/awxkit/awxkit/api/pages/api.py @@ -63,7 +63,6 @@ DEPENDENT_NONEXPORT = [ class Api(base.Base): - pass @@ -71,7 +70,6 @@ page.register_page(resources.api, Api) class ApiV2(base.Base): - # Export methods def _export(self, _page, post_fields): diff --git a/awxkit/awxkit/api/pages/applications.py b/awxkit/awxkit/api/pages/applications.py index a3ea0d29bd..3c9e4a8d76 100644 --- a/awxkit/awxkit/api/pages/applications.py +++ b/awxkit/awxkit/api/pages/applications.py @@ -8,7 +8,6 @@ from . import base class OAuth2Application(HasCreate, base.Base): - dependencies = [Organization] NATURAL_KEY = ('organization', 'name') @@ -49,7 +48,6 @@ page.register_page(resources.applications, OAuth2Applications) class OAuth2AccessToken(HasCreate, base.Base): - optional_dependencies = [OAuth2Application] def payload(self, **kwargs): diff --git a/awxkit/awxkit/api/pages/authtoken.py b/awxkit/awxkit/api/pages/authtoken.py index fd5b2824ed..36ec0b9546 100644 --- a/awxkit/awxkit/api/pages/authtoken.py +++ b/awxkit/awxkit/api/pages/authtoken.py @@ -4,7 +4,6 @@ from . import page class AuthToken(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/credential_input_sources.py b/awxkit/awxkit/api/pages/credential_input_sources.py index c500cfca81..3b96fa72b6 100644 --- a/awxkit/awxkit/api/pages/credential_input_sources.py +++ b/awxkit/awxkit/api/pages/credential_input_sources.py @@ -4,7 +4,6 @@ from . import page class CredentialInputSource(base.Base): - pass @@ -12,7 +11,6 @@ page.register_page(resources.credential_input_source, CredentialInputSource) class CredentialInputSources(page.PageList, CredentialInputSource): - pass diff --git a/awxkit/awxkit/api/pages/credentials.py b/awxkit/awxkit/api/pages/credentials.py index ff108fe88a..2def3004ed 100644 --- a/awxkit/awxkit/api/pages/credentials.py +++ b/awxkit/awxkit/api/pages/credentials.py @@ -142,7 +142,6 @@ def get_payload_field_and_value_from_kwargs_or_config_cred(field, kind, kwargs, class CredentialType(HasCreate, base.Base): - NATURAL_KEY = ('name', 'kind') def silent_delete(self): @@ -182,7 +181,6 @@ page.register_page([resources.credential_type, (resources.credential_types, 'pos class CredentialTypes(page.PageList, CredentialType): - pass @@ -190,7 +188,6 @@ page.register_page(resources.credential_types, CredentialTypes) class Credential(HasCopy, HasCreate, base.Base): - dependencies = [CredentialType] optional_dependencies = [Organization, User, Team] NATURAL_KEY = ('organization', 'name', 'credential_type') @@ -296,7 +293,6 @@ page.register_page( class Credentials(page.PageList, Credential): - pass @@ -304,7 +300,6 @@ page.register_page([resources.credentials, resources.related_credentials, resour class CredentialCopy(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/dashboard.py b/awxkit/awxkit/api/pages/dashboard.py index 177a861f08..9524497af0 100644 --- a/awxkit/awxkit/api/pages/dashboard.py +++ b/awxkit/awxkit/api/pages/dashboard.py @@ -4,7 +4,6 @@ from . import page class Dashboard(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/execution_environments.py b/awxkit/awxkit/api/pages/execution_environments.py index f761fb6fdd..2f9b6d01e3 100644 --- a/awxkit/awxkit/api/pages/execution_environments.py +++ b/awxkit/awxkit/api/pages/execution_environments.py @@ -16,7 +16,6 @@ log = logging.getLogger(__name__) class ExecutionEnvironment(HasCreate, HasCopy, base.Base): - dependencies = [Organization, Credential] NATURAL_KEY = ('name',) diff --git a/awxkit/awxkit/api/pages/instance_groups.py b/awxkit/awxkit/api/pages/instance_groups.py index 40cc942927..4573ab63ca 100644 --- a/awxkit/awxkit/api/pages/instance_groups.py +++ b/awxkit/awxkit/api/pages/instance_groups.py @@ -39,7 +39,6 @@ page.register_page([resources.instance_group, (resources.instance_groups, 'post' class InstanceGroups(page.PageList, InstanceGroup): - pass diff --git a/awxkit/awxkit/api/pages/instances.py b/awxkit/awxkit/api/pages/instances.py index d30694ed6c..304cc5d382 100644 --- a/awxkit/awxkit/api/pages/instances.py +++ b/awxkit/awxkit/api/pages/instances.py @@ -4,7 +4,6 @@ from . import page class Instance(base.Base): - pass @@ -12,7 +11,6 @@ page.register_page(resources.instance, Instance) class Instances(page.PageList, Instance): - pass diff --git a/awxkit/awxkit/api/pages/inventory.py b/awxkit/awxkit/api/pages/inventory.py index 354fa2abbb..1ff9e02960 100644 --- a/awxkit/awxkit/api/pages/inventory.py +++ b/awxkit/awxkit/api/pages/inventory.py @@ -16,7 +16,6 @@ log = logging.getLogger(__name__) class Inventory(HasCopy, HasCreate, HasInstanceGroups, HasVariables, base.Base): - dependencies = [Organization] NATURAL_KEY = ('organization', 'name') @@ -130,7 +129,6 @@ page.register_page([resources.inventory, (resources.inventories, 'post'), (resou class Inventories(page.PageList, Inventory): - pass @@ -138,7 +136,6 @@ page.register_page([resources.inventories, resources.related_inventories], Inven class Group(HasCreate, HasVariables, base.Base): - dependencies = [Inventory] optional_dependencies = [Credential] NATURAL_KEY = ('name', 'inventory') @@ -213,7 +210,6 @@ page.register_page([resources.group, (resources.groups, 'post')], Group) class Groups(page.PageList, Group): - pass @@ -231,7 +227,6 @@ page.register_page( class Host(HasCreate, HasVariables, base.Base): - dependencies = [Inventory] NATURAL_KEY = ('name', 'inventory') @@ -273,7 +268,6 @@ page.register_page([resources.host, (resources.hosts, 'post')], Host) class Hosts(page.PageList, Host): - pass @@ -281,7 +275,6 @@ page.register_page([resources.hosts, resources.group_related_hosts, resources.in class FactVersion(base.Base): - pass @@ -298,7 +291,6 @@ page.register_page(resources.host_related_fact_versions, FactVersions) class FactView(base.Base): - pass @@ -306,7 +298,6 @@ page.register_page(resources.fact_view, FactView) class InventorySource(HasCreate, HasNotifications, UnifiedJobTemplate): - optional_schedule_fields = tuple() dependencies = [Inventory] optional_dependencies = [Credential, Project] @@ -403,7 +394,6 @@ page.register_page([resources.inventory_source, (resources.inventory_sources, 'p class InventorySources(page.PageList, InventorySource): - pass @@ -411,7 +401,6 @@ page.register_page([resources.inventory_sources, resources.related_inventory_sou class InventorySourceGroups(page.PageList, Group): - pass @@ -419,7 +408,6 @@ page.register_page(resources.inventory_sources_related_groups, InventorySourceGr class InventorySourceUpdate(base.Base): - pass @@ -427,7 +415,6 @@ page.register_page([resources.inventory_sources_related_update, resources.invent class InventoryUpdate(UnifiedJob): - pass @@ -435,7 +422,6 @@ page.register_page(resources.inventory_update, InventoryUpdate) class InventoryUpdates(page.PageList, InventoryUpdate): - pass @@ -443,7 +429,6 @@ page.register_page([resources.inventory_updates, resources.inventory_source_upda class InventoryUpdateCancel(base.Base): - pass @@ -451,7 +436,6 @@ page.register_page(resources.inventory_update_cancel, InventoryUpdateCancel) class InventoryCopy(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/job_templates.py b/awxkit/awxkit/api/pages/job_templates.py index 5378059843..151442094e 100644 --- a/awxkit/awxkit/api/pages/job_templates.py +++ b/awxkit/awxkit/api/pages/job_templates.py @@ -11,7 +11,6 @@ from . import page class JobTemplate(HasCopy, HasCreate, HasInstanceGroups, HasNotifications, HasSurvey, UnifiedJobTemplate): - optional_dependencies = [Inventory, Credential, Project] NATURAL_KEY = ('organization', 'name') @@ -153,7 +152,6 @@ page.register_page([resources.job_template, (resources.job_templates, 'post'), ( class JobTemplates(page.PageList, JobTemplate): - pass @@ -161,7 +159,6 @@ page.register_page([resources.job_templates, resources.related_job_templates], J class JobTemplateCallback(base.Base): - pass @@ -169,7 +166,6 @@ page.register_page(resources.job_template_callback, JobTemplateCallback) class JobTemplateLaunch(base.Base): - pass @@ -177,7 +173,6 @@ page.register_page(resources.job_template_launch, JobTemplateLaunch) class JobTemplateCopy(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/jobs.py b/awxkit/awxkit/api/pages/jobs.py index 358009e59b..6b65cbaa91 100644 --- a/awxkit/awxkit/api/pages/jobs.py +++ b/awxkit/awxkit/api/pages/jobs.py @@ -14,7 +14,6 @@ page.register_page(resources.job, Job) class Jobs(page.PageList, Job): - pass @@ -22,7 +21,6 @@ page.register_page([resources.jobs, resources.job_template_jobs, resources.syste class JobCancel(UnifiedJob): - pass @@ -30,7 +28,6 @@ page.register_page(resources.job_cancel, JobCancel) class JobEvent(base.Base): - pass @@ -38,7 +35,6 @@ page.register_page([resources.job_event, resources.job_job_event], JobEvent) class JobEvents(page.PageList, JobEvent): - pass @@ -46,7 +42,6 @@ page.register_page([resources.job_events, resources.job_job_events, resources.jo class JobPlay(base.Base): - pass @@ -54,7 +49,6 @@ page.register_page(resources.job_play, JobPlay) class JobPlays(page.PageList, JobPlay): - pass @@ -62,7 +56,6 @@ page.register_page(resources.job_plays, JobPlays) class JobTask(base.Base): - pass @@ -70,7 +63,6 @@ page.register_page(resources.job_task, JobTask) class JobTasks(page.PageList, JobTask): - pass @@ -78,7 +70,6 @@ page.register_page(resources.job_tasks, JobTasks) class JobHostSummary(base.Base): - pass @@ -86,7 +77,6 @@ page.register_page(resources.job_host_summary, JobHostSummary) class JobHostSummaries(page.PageList, JobHostSummary): - pass @@ -94,7 +84,6 @@ page.register_page([resources.job_host_summaries, resources.group_related_job_ho class JobRelaunch(base.Base): - pass @@ -102,7 +91,6 @@ page.register_page(resources.job_relaunch, JobRelaunch) class JobStdout(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/labels.py b/awxkit/awxkit/api/pages/labels.py index 4fb109364d..79f20b36a5 100644 --- a/awxkit/awxkit/api/pages/labels.py +++ b/awxkit/awxkit/api/pages/labels.py @@ -7,7 +7,6 @@ from . import page class Label(HasCreate, base.Base): - dependencies = [Organization] NATURAL_KEY = ('organization', 'name') @@ -40,7 +39,6 @@ page.register_page([resources.label, (resources.labels, 'post')], Label) class Labels(page.PageList, Label): - pass diff --git a/awxkit/awxkit/api/pages/mesh_visualizer.py b/awxkit/awxkit/api/pages/mesh_visualizer.py index c5dad782d1..2b490e5158 100644 --- a/awxkit/awxkit/api/pages/mesh_visualizer.py +++ b/awxkit/awxkit/api/pages/mesh_visualizer.py @@ -4,7 +4,6 @@ from . import page class MeshVisualizer(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/notification_templates.py b/awxkit/awxkit/api/pages/notification_templates.py index 927daaf775..3d33300ce8 100644 --- a/awxkit/awxkit/api/pages/notification_templates.py +++ b/awxkit/awxkit/api/pages/notification_templates.py @@ -15,7 +15,6 @@ notification_types = ('email', 'irc', 'pagerduty', 'slack', 'twilio', 'webhook', class NotificationTemplate(HasCopy, HasCreate, base.Base): - dependencies = [Organization] NATURAL_KEY = ('organization', 'name') @@ -40,7 +39,7 @@ class NotificationTemplate(HasCopy, HasCreate, base.Base): """ try: super(NotificationTemplate, self).silent_delete() - except (exc.MethodNotAllowed): + except exc.MethodNotAllowed: pass def payload(self, organization, notification_type='slack', messages=not_provided, **kwargs): @@ -156,7 +155,6 @@ page.register_page( class NotificationTemplates(page.PageList, NotificationTemplate): - pass @@ -175,7 +173,6 @@ page.register_page( class NotificationTemplateCopy(base.Base): - pass @@ -183,7 +180,6 @@ page.register_page(resources.notification_template_copy, NotificationTemplateCop class NotificationTemplateTest(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/organizations.py b/awxkit/awxkit/api/pages/organizations.py index 1635eec15b..c3f913a927 100644 --- a/awxkit/awxkit/api/pages/organizations.py +++ b/awxkit/awxkit/api/pages/organizations.py @@ -9,7 +9,6 @@ from . import page class Organization(HasCreate, HasInstanceGroups, HasNotifications, base.Base): - NATURAL_KEY = ('name',) def add_admin(self, user): @@ -68,7 +67,6 @@ page.register_page([resources.organization, (resources.organizations, 'post')], class Organizations(page.PageList, Organization): - pass diff --git a/awxkit/awxkit/api/pages/page.py b/awxkit/awxkit/api/pages/page.py index 65f3012587..4c26fd5314 100644 --- a/awxkit/awxkit/api/pages/page.py +++ b/awxkit/awxkit/api/pages/page.py @@ -89,7 +89,6 @@ def objectify_response_json(response): class Page(object): - endpoint = '' def __init__(self, connection=None, *a, **kw): @@ -199,7 +198,6 @@ class Page(object): raise exception(exc_str, data) if response.status_code in (http.OK, http.CREATED, http.ACCEPTED): - # Not all JSON responses include a URL. Grab it from the request # object, if needed. if 'url' in data: @@ -337,7 +335,6 @@ def exception_from_status_code(status_code): class PageList(object): - NATURAL_KEY = None @property diff --git a/awxkit/awxkit/api/pages/ping.py b/awxkit/awxkit/api/pages/ping.py index 7a5a42e514..e0b94b12ce 100644 --- a/awxkit/awxkit/api/pages/ping.py +++ b/awxkit/awxkit/api/pages/ping.py @@ -4,7 +4,6 @@ from . import page class Ping(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/projects.py b/awxkit/awxkit/api/pages/projects.py index ec0613b181..125f452637 100644 --- a/awxkit/awxkit/api/pages/projects.py +++ b/awxkit/awxkit/api/pages/projects.py @@ -11,7 +11,6 @@ from . import page class Project(HasCopy, HasCreate, HasNotifications, UnifiedJobTemplate): - optional_dependencies = [Credential, Organization] optional_schedule_fields = tuple() NATURAL_KEY = ('organization', 'name') @@ -131,7 +130,6 @@ page.register_page([resources.project, (resources.projects, 'post'), (resources. class Projects(page.PageList, Project): - pass @@ -139,7 +137,6 @@ page.register_page([resources.projects, resources.related_projects], Projects) class ProjectUpdate(UnifiedJob): - pass @@ -147,7 +144,6 @@ page.register_page(resources.project_update, ProjectUpdate) class ProjectUpdates(page.PageList, ProjectUpdate): - pass @@ -155,7 +151,6 @@ page.register_page([resources.project_updates, resources.project_project_updates class ProjectUpdateLaunch(base.Base): - pass @@ -163,7 +158,6 @@ page.register_page(resources.project_related_update, ProjectUpdateLaunch) class ProjectUpdateCancel(base.Base): - pass @@ -171,7 +165,6 @@ page.register_page(resources.project_update_cancel, ProjectUpdateCancel) class ProjectCopy(base.Base): - pass @@ -179,7 +172,6 @@ page.register_page(resources.project_copy, ProjectCopy) class Playbooks(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/roles.py b/awxkit/awxkit/api/pages/roles.py index 07f0790b60..949579160a 100644 --- a/awxkit/awxkit/api/pages/roles.py +++ b/awxkit/awxkit/api/pages/roles.py @@ -10,7 +10,6 @@ log = logging.getLogger(__name__) class Role(base.Base): - NATURAL_KEY = ('name',) def get_natural_key(self, cache=None): @@ -33,7 +32,6 @@ page.register_page(resources.role, Role) class Roles(page.PageList, Role): - pass diff --git a/awxkit/awxkit/api/pages/schedules.py b/awxkit/awxkit/api/pages/schedules.py index 1fa34c81e6..6043d257c1 100644 --- a/awxkit/awxkit/api/pages/schedules.py +++ b/awxkit/awxkit/api/pages/schedules.py @@ -61,7 +61,6 @@ page.register_page([resources.schedules, resources.related_schedules], Schedules class SchedulesPreview(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/settings.py b/awxkit/awxkit/api/pages/settings.py index 59168d40c5..12fa7e2910 100644 --- a/awxkit/awxkit/api/pages/settings.py +++ b/awxkit/awxkit/api/pages/settings.py @@ -4,7 +4,6 @@ from . import page class Setting(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/system_job_templates.py b/awxkit/awxkit/api/pages/system_job_templates.py index 985d15deb4..9362fbccb3 100644 --- a/awxkit/awxkit/api/pages/system_job_templates.py +++ b/awxkit/awxkit/api/pages/system_job_templates.py @@ -21,7 +21,6 @@ page.register_page(resources.system_job_template, SystemJobTemplate) class SystemJobTemplates(page.PageList, SystemJobTemplate): - pass diff --git a/awxkit/awxkit/api/pages/system_jobs.py b/awxkit/awxkit/api/pages/system_jobs.py index 231aa346c0..d2bf8f982f 100644 --- a/awxkit/awxkit/api/pages/system_jobs.py +++ b/awxkit/awxkit/api/pages/system_jobs.py @@ -4,7 +4,6 @@ from . import page class SystemJob(UnifiedJob): - pass @@ -12,7 +11,6 @@ page.register_page(resources.system_job, SystemJob) class SystemJobs(page.PageList, SystemJob): - pass @@ -20,7 +18,6 @@ page.register_page(resources.system_jobs, SystemJobs) class SystemJobCancel(UnifiedJob): - pass diff --git a/awxkit/awxkit/api/pages/teams.py b/awxkit/awxkit/api/pages/teams.py index 2ae928e88a..f5614a0c25 100644 --- a/awxkit/awxkit/api/pages/teams.py +++ b/awxkit/awxkit/api/pages/teams.py @@ -11,7 +11,6 @@ from . import page class Team(HasCreate, base.Base): - dependencies = [Organization] NATURAL_KEY = ('organization', 'name') @@ -44,7 +43,6 @@ page.register_page([resources.team, (resources.teams, 'post')], Team) class Teams(page.PageList, Team): - pass diff --git a/awxkit/awxkit/api/pages/unified_job_templates.py b/awxkit/awxkit/api/pages/unified_job_templates.py index e7499e23e6..c99e35f154 100644 --- a/awxkit/awxkit/api/pages/unified_job_templates.py +++ b/awxkit/awxkit/api/pages/unified_job_templates.py @@ -75,7 +75,6 @@ page.register_page(resources.unified_job_template, UnifiedJobTemplate) class UnifiedJobTemplates(page.PageList, UnifiedJobTemplate): - pass diff --git a/awxkit/awxkit/api/pages/unified_jobs.py b/awxkit/awxkit/api/pages/unified_jobs.py index 09dea1ebbb..2c46a2db84 100644 --- a/awxkit/awxkit/api/pages/unified_jobs.py +++ b/awxkit/awxkit/api/pages/unified_jobs.py @@ -152,7 +152,6 @@ class UnifiedJob(HasStatus, base.Base): class UnifiedJobs(page.PageList, UnifiedJob): - pass diff --git a/awxkit/awxkit/api/pages/users.py b/awxkit/awxkit/api/pages/users.py index f8a4d9cc17..bc9731e00a 100644 --- a/awxkit/awxkit/api/pages/users.py +++ b/awxkit/awxkit/api/pages/users.py @@ -8,7 +8,6 @@ from . import page class User(HasCreate, base.Base): - NATURAL_KEY = ('username',) def payload(self, **kwargs): @@ -44,7 +43,6 @@ page.register_page([resources.user, (resources.users, 'post')], User) class Users(page.PageList, User): - pass @@ -54,7 +52,6 @@ page.register_page( class Me(Users): - pass diff --git a/awxkit/awxkit/api/pages/workflow_approval_templates.py b/awxkit/awxkit/api/pages/workflow_approval_templates.py index 2796a81f25..1fc149f1a1 100644 --- a/awxkit/awxkit/api/pages/workflow_approval_templates.py +++ b/awxkit/awxkit/api/pages/workflow_approval_templates.py @@ -4,7 +4,6 @@ from . import page class WorkflowApprovalTemplate(UnifiedJobTemplate): - pass @@ -18,7 +17,6 @@ page.register_page( class WorkflowApprovalTemplates(page.PageList, WorkflowApprovalTemplate): - pass diff --git a/awxkit/awxkit/api/pages/workflow_approvals.py b/awxkit/awxkit/api/pages/workflow_approvals.py index bd26aae7e3..76bdbe9677 100644 --- a/awxkit/awxkit/api/pages/workflow_approvals.py +++ b/awxkit/awxkit/api/pages/workflow_approvals.py @@ -22,7 +22,6 @@ page.register_page(resources.workflow_approval, WorkflowApproval) class WorkflowApprovals(page.PageList, WorkflowApproval): - pass diff --git a/awxkit/awxkit/api/pages/workflow_job_nodes.py b/awxkit/awxkit/api/pages/workflow_job_nodes.py index 4eabaebe16..410e21ae4b 100644 --- a/awxkit/awxkit/api/pages/workflow_job_nodes.py +++ b/awxkit/awxkit/api/pages/workflow_job_nodes.py @@ -25,7 +25,6 @@ page.register_page(resources.workflow_job_node, WorkflowJobNode) class WorkflowJobNodes(page.PageList, WorkflowJobNode): - pass diff --git a/awxkit/awxkit/api/pages/workflow_job_template_nodes.py b/awxkit/awxkit/api/pages/workflow_job_template_nodes.py index 3177c24e50..769b7241ee 100644 --- a/awxkit/awxkit/api/pages/workflow_job_template_nodes.py +++ b/awxkit/awxkit/api/pages/workflow_job_template_nodes.py @@ -9,7 +9,6 @@ from . import page class WorkflowJobTemplateNode(HasCreate, base.Base): - dependencies = [WorkflowJobTemplate, UnifiedJobTemplate] NATURAL_KEY = ('workflow_job_template', 'identifier') @@ -113,7 +112,6 @@ page.register_page( class WorkflowJobTemplateNodes(page.PageList, WorkflowJobTemplateNode): - pass diff --git a/awxkit/awxkit/api/pages/workflow_job_templates.py b/awxkit/awxkit/api/pages/workflow_job_templates.py index 42a691d5ea..ef564d66a8 100644 --- a/awxkit/awxkit/api/pages/workflow_job_templates.py +++ b/awxkit/awxkit/api/pages/workflow_job_templates.py @@ -12,7 +12,6 @@ from . import page class WorkflowJobTemplate(HasCopy, HasCreate, HasNotifications, HasSurvey, UnifiedJobTemplate): - optional_dependencies = [Organization] NATURAL_KEY = ('organization', 'name') @@ -100,7 +99,6 @@ page.register_page( class WorkflowJobTemplates(page.PageList, WorkflowJobTemplate): - pass @@ -108,7 +106,6 @@ page.register_page([resources.workflow_job_templates, resources.related_workflow class WorkflowJobTemplateLaunch(base.Base): - pass @@ -116,7 +113,6 @@ page.register_page(resources.workflow_job_template_launch, WorkflowJobTemplateLa class WorkflowJobTemplateCopy(base.Base): - pass diff --git a/awxkit/awxkit/api/pages/workflow_jobs.py b/awxkit/awxkit/api/pages/workflow_jobs.py index 200eb0ef30..f444ea4a83 100644 --- a/awxkit/awxkit/api/pages/workflow_jobs.py +++ b/awxkit/awxkit/api/pages/workflow_jobs.py @@ -51,7 +51,6 @@ page.register_page(resources.workflow_job, WorkflowJob) class WorkflowJobs(page.PageList, WorkflowJob): - pass diff --git a/awxkit/awxkit/api/resources.py b/awxkit/awxkit/api/resources.py index 982e7c2573..5874b3d0de 100644 --- a/awxkit/awxkit/api/resources.py +++ b/awxkit/awxkit/api/resources.py @@ -1,5 +1,4 @@ class Resources(object): - _activity = r'activity_stream/\d+/' _activity_stream = 'activity_stream/' _ad_hoc_command = r'ad_hoc_commands/\d+/' diff --git a/awxkit/awxkit/cli/custom.py b/awxkit/awxkit/cli/custom.py index b1bd6de93f..f1453562dd 100644 --- a/awxkit/awxkit/cli/custom.py +++ b/awxkit/awxkit/cli/custom.py @@ -148,7 +148,6 @@ class WorkflowLaunch(Launchable, CustomAction): class HasStdout(object): - action = 'stdout' def add_arguments(self, parser, resource_options_parser): @@ -180,7 +179,6 @@ class AdhocCommandStdout(HasStdout, CustomAction): class AssociationMixin(object): - action = 'associate' def add_arguments(self, parser, resource_options_parser): @@ -344,7 +342,6 @@ class SettingsList(CustomAction): class RoleMixin(object): - has_roles = [ ['organizations', 'organization'], ['projects', 'project'], @@ -427,25 +424,21 @@ class RoleMixin(object): class UserGrant(RoleMixin, CustomAction): - resource = 'users' action = 'grant' class UserRevoke(RoleMixin, CustomAction): - resource = 'users' action = 'revoke' class TeamGrant(RoleMixin, CustomAction): - resource = 'teams' action = 'grant' class TeamRevoke(RoleMixin, CustomAction): - resource = 'teams' action = 'revoke' @@ -476,7 +469,6 @@ class SettingsModify(CustomAction): class HasMonitor(object): - action = 'monitor' def add_arguments(self, parser, resource_options_parser): diff --git a/awxkit/awxkit/cli/options.py b/awxkit/awxkit/cli/options.py index fe200f71a1..6c85986633 100644 --- a/awxkit/awxkit/cli/options.py +++ b/awxkit/awxkit/cli/options.py @@ -74,7 +74,6 @@ class JsonDumpsAction(argparse.Action): class ResourceOptionsParser(object): - deprecated = False def __init__(self, v2, page, resource, parser): diff --git a/awxkit/awxkit/exceptions.py b/awxkit/awxkit/exceptions.py index 84c37d615e..5789fd9c48 100644 --- a/awxkit/awxkit/exceptions.py +++ b/awxkit/awxkit/exceptions.py @@ -17,90 +17,72 @@ class Common(Exception): class BadRequest(Common): - pass class Conflict(Common): - pass class Duplicate(Common): - pass class Forbidden(Common): - pass class InternalServerError(Common): - pass class BadGateway(Common): - pass class LicenseExceeded(Common): - pass class LicenseInvalid(Common): - pass class MethodNotAllowed(Common): - pass class NoContent(Common): - message = '' class NotFound(Common): - pass class PaymentRequired(Common): - pass class Unauthorized(Common): - pass class Unknown(Common): - pass class WaitUntilTimeout(Common): - pass class UnexpectedAWXState(Common): - pass class IsMigrating(Common): - pass class ImportExportError(Exception): - pass diff --git a/awxkit/awxkit/utils/__init__.py b/awxkit/awxkit/utils/__init__.py index cb54eb0ce5..8b47b4e5d9 100644 --- a/awxkit/awxkit/utils/__init__.py +++ b/awxkit/awxkit/utils/__init__.py @@ -117,7 +117,7 @@ class PseudoNamespace(dict): for key in iterable: self[key] = iterable[key] else: - for (k, v) in iterable: + for k, v in iterable: self[k] = v for k in kw: self[k] = kw[k] diff --git a/awxkit/awxkit/ws.py b/awxkit/awxkit/ws.py index b2b51fefba..8e8eea4a16 100644 --- a/awxkit/awxkit/ws.py +++ b/awxkit/awxkit/ws.py @@ -15,7 +15,6 @@ log = logging.getLogger(__name__) class WSClientException(Exception): - pass diff --git a/awxkit/test/test_dependency_resolver.py b/awxkit/test/test_dependency_resolver.py index 83312b8bf9..3c7469896f 100644 --- a/awxkit/test/test_dependency_resolver.py +++ b/awxkit/test/test_dependency_resolver.py @@ -6,7 +6,6 @@ from awxkit.api.mixins import has_create class MockHasCreate(has_create.HasCreate): - connection = None def __str__(self): @@ -26,7 +25,6 @@ class A(MockHasCreate): class B(MockHasCreate): - optional_dependencies = [A] def create(self, a=None, **kw): @@ -35,7 +33,6 @@ class B(MockHasCreate): class C(MockHasCreate): - dependencies = [A, B] def create(self, a=A, b=B, **kw): @@ -44,7 +41,6 @@ class C(MockHasCreate): class D(MockHasCreate): - dependencies = [A] optional_dependencies = [B] @@ -54,7 +50,6 @@ class D(MockHasCreate): class E(MockHasCreate): - dependencies = [D, C] def create(self, c=C, d=D, **kw): @@ -63,7 +58,6 @@ class E(MockHasCreate): class F(MockHasCreate): - dependencies = [B] optional_dependencies = [E] @@ -73,7 +67,6 @@ class F(MockHasCreate): class G(MockHasCreate): - dependencies = [D] optional_dependencies = [F, E] @@ -83,7 +76,6 @@ class G(MockHasCreate): class H(MockHasCreate): - optional_dependencies = [E, A] def create(self, a=None, e=None, **kw): @@ -97,7 +89,6 @@ class MultipleWordClassName(MockHasCreate): class AnotherMultipleWordClassName(MockHasCreate): - optional_dependencies = [MultipleWordClassName] def create(self, multiple_word_class_name=None, **kw): @@ -466,7 +457,6 @@ class OneWithArgs(MockHasCreate): class TwoWithArgs(MockHasCreate): - dependencies = [OneWithArgs] def create(self, one_with_args=OneWithArgs, **kw): @@ -478,7 +468,6 @@ class TwoWithArgs(MockHasCreate): class ThreeWithArgs(MockHasCreate): - dependencies = [OneWithArgs] optional_dependencies = [TwoWithArgs] @@ -489,7 +478,6 @@ class ThreeWithArgs(MockHasCreate): class FourWithArgs(MockHasCreate): - dependencies = [TwoWithArgs, ThreeWithArgs] def create(self, two_with_args=TwoWithArgs, three_with_args=ThreeWithArgs, **kw): @@ -558,7 +546,6 @@ def test_tuples_for_class_arg_cause_unshared_dependencies_when_downstream(): class NotHasCreate(object): - pass @@ -583,7 +570,6 @@ class MixinUserD(MixinUserC): class NotHasCreateDependencyHolder(MockHasCreate): - dependencies = [NotHasCreate] def create(self, not_has_create=MixinUserA): @@ -608,7 +594,6 @@ def test_not_has_create_passed_dependency(): class HasCreateParentDependencyHolder(MockHasCreate): - dependencies = [MixinUserB] def create(self, mixin_user_b=MixinUserC): @@ -626,7 +611,6 @@ def test_has_create_stored_as_parent_dependency(): class DynamicallyDeclaresNotHasCreateDependency(MockHasCreate): - dependencies = [NotHasCreate] def create(self, not_has_create=MixinUserA): @@ -645,7 +629,6 @@ def test_subclass_or_parent_dynamic_not_has_create_dependency_declaration(depend class DynamicallyDeclaresHasCreateDependency(MockHasCreate): - dependencies = [MixinUserB] def create(self, mixin_user_b=MixinUserB): diff --git a/awxkit/test/test_registry.py b/awxkit/test/test_registry.py index b0f0f2527f..c17afcac91 100644 --- a/awxkit/test/test_registry.py +++ b/awxkit/test/test_registry.py @@ -4,12 +4,10 @@ from awxkit.api.registry import URLRegistry class One(object): - pass class Two(object): - pass -- cgit v1.2.3