nautobot 2.3.15b1__py3-none-any.whl → 2.3.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nautobot might be problematic. Click here for more details.
- nautobot/circuits/views.py +3 -3
- nautobot/cloud/models.py +1 -1
- nautobot/core/api/fields.py +5 -5
- nautobot/core/api/serializers.py +9 -9
- nautobot/core/api/views.py +3 -2
- nautobot/core/apps/__init__.py +5 -2
- nautobot/core/celery/schedulers.py +1 -1
- nautobot/core/filters.py +19 -16
- nautobot/core/forms/fields.py +5 -5
- nautobot/core/graphql/types.py +1 -1
- nautobot/core/jobs/__init__.py +4 -4
- nautobot/core/jobs/cleanup.py +1 -1
- nautobot/core/jobs/groups.py +1 -1
- nautobot/core/management/commands/validate_models.py +1 -1
- nautobot/core/models/__init__.py +1 -1
- nautobot/core/models/query_functions.py +2 -2
- nautobot/core/models/tree_queries.py +2 -2
- nautobot/core/settings.py +3 -0
- nautobot/core/settings.yaml +8 -0
- nautobot/core/tables.py +5 -5
- nautobot/core/templates/inc/media.html +3 -0
- nautobot/core/templates/nautobot_config.py.j2 +3 -0
- nautobot/core/testing/filters.py +7 -3
- nautobot/core/testing/views.py +5 -0
- nautobot/core/tests/integration/test_app_home.py +0 -1
- nautobot/core/tests/integration/test_app_navbar.py +0 -1
- nautobot/core/tests/integration/test_filters.py +0 -2
- nautobot/core/tests/integration/test_home.py +0 -1
- nautobot/core/tests/integration/test_navbar.py +0 -1
- nautobot/core/tests/integration/test_view_authentication.py +1 -0
- nautobot/core/tests/runner.py +1 -1
- nautobot/core/tests/test_views.py +29 -0
- nautobot/core/urls.py +9 -0
- nautobot/core/views/generic.py +51 -43
- nautobot/core/views/mixins.py +21 -11
- nautobot/dcim/api/serializers.py +48 -48
- nautobot/dcim/forms.py +2 -0
- nautobot/dcim/graphql/types.py +2 -2
- nautobot/dcim/models/device_component_templates.py +2 -2
- nautobot/dcim/models/device_components.py +22 -20
- nautobot/dcim/models/devices.py +1 -1
- nautobot/dcim/models/locations.py +3 -3
- nautobot/dcim/models/power.py +6 -5
- nautobot/dcim/models/racks.py +4 -4
- nautobot/dcim/tables/__init__.py +3 -3
- nautobot/dcim/tables/devicetypes.py +2 -2
- nautobot/dcim/tests/test_filters.py +1 -0
- nautobot/dcim/tests/test_graphql.py +52 -0
- nautobot/dcim/tests/test_models.py +4 -1
- nautobot/dcim/views.py +1 -1
- nautobot/extras/api/customfields.py +2 -2
- nautobot/extras/api/serializers.py +72 -69
- nautobot/extras/api/views.py +4 -4
- nautobot/extras/forms/mixins.py +1 -1
- nautobot/extras/health_checks.py +1 -2
- nautobot/extras/jobs.py +5 -5
- nautobot/extras/managers.py +3 -1
- nautobot/extras/migrations/0018_joblog_data_migration.py +7 -9
- nautobot/extras/models/customfields.py +12 -11
- nautobot/extras/models/groups.py +13 -9
- nautobot/extras/models/jobs.py +4 -4
- nautobot/extras/models/models.py +2 -2
- nautobot/extras/plugins/views.py +1 -1
- nautobot/extras/tables.py +5 -5
- nautobot/extras/test_jobs/api_test_job.py +1 -1
- nautobot/extras/test_jobs/atomic_transaction.py +2 -2
- nautobot/extras/test_jobs/dry_run.py +1 -1
- nautobot/extras/test_jobs/fail.py +5 -5
- nautobot/extras/test_jobs/file_output.py +1 -1
- nautobot/extras/test_jobs/file_upload_fail.py +1 -1
- nautobot/extras/test_jobs/file_upload_pass.py +1 -1
- nautobot/extras/test_jobs/ipaddress_vars.py +3 -1
- nautobot/extras/test_jobs/jobs_module/jobs_submodule/jobs.py +1 -1
- nautobot/extras/test_jobs/location_with_custom_field.py +1 -1
- nautobot/extras/test_jobs/log_redaction.py +1 -1
- nautobot/extras/test_jobs/log_skip_db_logging.py +1 -1
- nautobot/extras/test_jobs/modify_db.py +1 -1
- nautobot/extras/test_jobs/object_var_optional.py +1 -1
- nautobot/extras/test_jobs/object_var_required.py +1 -1
- nautobot/extras/test_jobs/object_vars.py +1 -1
- nautobot/extras/test_jobs/pass.py +3 -3
- nautobot/extras/test_jobs/profiling.py +1 -1
- nautobot/extras/test_jobs/relative_import.py +3 -3
- nautobot/extras/test_jobs/soft_time_limit_greater_than_time_limit.py +1 -1
- nautobot/extras/test_jobs/task_queues.py +1 -1
- nautobot/extras/tests/integration/test_plugin_banner.py +0 -2
- nautobot/extras/tests/test_api.py +13 -13
- nautobot/extras/tests/test_customfields.py +1 -1
- nautobot/extras/tests/test_datasources.py +2 -1
- nautobot/extras/tests/test_dynamicgroups.py +1 -1
- nautobot/extras/tests/test_filters.py +6 -6
- nautobot/extras/tests/test_forms.py +20 -1
- nautobot/extras/tests/test_jobs.py +11 -11
- nautobot/extras/tests/test_models.py +10 -10
- nautobot/extras/tests/test_relationships.py +1 -1
- nautobot/extras/tests/test_views.py +16 -16
- nautobot/extras/views.py +20 -16
- nautobot/ipam/api/fields.py +3 -3
- nautobot/ipam/api/serializers.py +33 -33
- nautobot/ipam/api/views.py +37 -61
- nautobot/ipam/querysets.py +2 -2
- nautobot/ipam/tests/test_api.py +12 -1
- nautobot/ipam/tests/test_forms.py +51 -47
- nautobot/ipam/tests/test_migrations.py +30 -30
- nautobot/ipam/tests/test_querysets.py +14 -0
- nautobot/project-static/docs/404.html +2 -2
- nautobot/project-static/docs/apps/index.html +2 -2
- nautobot/project-static/docs/apps/nautobot-apps.html +2 -2
- nautobot/project-static/docs/assets/javascripts/{bundle.83f73b43.min.js → bundle.88dd0f4e.min.js} +2 -2
- nautobot/project-static/docs/assets/javascripts/{bundle.83f73b43.min.js.map → bundle.88dd0f4e.min.js.map} +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/__init__.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/admin.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/api.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/change_logging.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/choices.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/config.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/constants.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/datasources.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/exceptions.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/factory.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/filters.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/forms.html +3 -3
- nautobot/project-static/docs/code-reference/nautobot/apps/graphql.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/jobs.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/models.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/querysets.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/secrets.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/tables.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/testing.html +3 -3
- nautobot/project-static/docs/code-reference/nautobot/apps/ui.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/urls.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/utils.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/views.html +4 -4
- nautobot/project-static/docs/development/apps/api/configuration-view.html +2 -2
- nautobot/project-static/docs/development/apps/api/database-backend-config.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/django-admin.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/global-search.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/graphql.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/nautobot-app-config.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/custom-validators.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/filter-extensions.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/git-repository-content.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/jinja2-filters.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/jobs.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/populating-extensibility-features.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/secrets-providers.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/table-extensions.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/uniquely-identify-objects.html +2 -2
- nautobot/project-static/docs/development/apps/api/prometheus.html +2 -2
- nautobot/project-static/docs/development/apps/api/setup.html +2 -2
- nautobot/project-static/docs/development/apps/api/testing.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/banners.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/home-page.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/navigation.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/object-views.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/base-template.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/core-view-overrides.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/django-generic-views.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/help-documentation.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/nautobot-generic-views.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewset.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewsetrouter.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/notes.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/rest-api.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/urls.html +2 -2
- nautobot/project-static/docs/development/apps/index.html +2 -2
- nautobot/project-static/docs/development/apps/migration/code-updates.html +2 -2
- nautobot/project-static/docs/development/apps/migration/dependency-updates.html +2 -2
- nautobot/project-static/docs/development/apps/migration/from-v1.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/dcim.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/extras.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/global.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/ipam.html +2 -2
- nautobot/project-static/docs/development/apps/porting-from-netbox.html +2 -2
- nautobot/project-static/docs/development/core/application-registry.html +2 -2
- nautobot/project-static/docs/development/core/best-practices.html +2 -2
- nautobot/project-static/docs/development/core/bootstrap-ui.html +2 -2
- nautobot/project-static/docs/development/core/caching.html +2 -2
- nautobot/project-static/docs/development/core/controllers.html +2 -2
- nautobot/project-static/docs/development/core/docker-compose-advanced-use-cases.html +27 -70
- nautobot/project-static/docs/development/core/generic-views.html +2 -2
- nautobot/project-static/docs/development/core/getting-started.html +2 -2
- nautobot/project-static/docs/development/core/homepage.html +2 -2
- nautobot/project-static/docs/development/core/index.html +2 -2
- nautobot/project-static/docs/development/core/model-checklist.html +2 -2
- nautobot/project-static/docs/development/core/model-features.html +2 -2
- nautobot/project-static/docs/development/core/natural-keys.html +2 -2
- nautobot/project-static/docs/development/core/navigation-menu.html +2 -2
- nautobot/project-static/docs/development/core/release-checklist.html +2 -2
- nautobot/project-static/docs/development/core/role-internals.html +2 -2
- nautobot/project-static/docs/development/core/settings.html +2 -2
- nautobot/project-static/docs/development/core/style-guide.html +2 -2
- nautobot/project-static/docs/development/core/templates.html +2 -2
- nautobot/project-static/docs/development/core/testing.html +2 -2
- nautobot/project-static/docs/development/core/user-preferences.html +2 -2
- nautobot/project-static/docs/development/index.html +2 -2
- nautobot/project-static/docs/development/jobs/index.html +2 -2
- nautobot/project-static/docs/development/jobs/migration/from-v1.html +2 -2
- nautobot/project-static/docs/index.html +2 -2
- nautobot/project-static/docs/overview/application_stack.html +2 -2
- nautobot/project-static/docs/overview/design_philosophy.html +2 -2
- nautobot/project-static/docs/release-notes/index.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.0.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.1.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.2.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.3.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.4.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.5.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.6.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.0.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.1.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.2.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.3.html +471 -220
- nautobot/project-static/docs/requirements.txt +2 -2
- nautobot/project-static/docs/search/search_index.json +1 -1
- nautobot/project-static/docs/sitemap.xml +270 -270
- nautobot/project-static/docs/sitemap.xml.gz +0 -0
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/ldap.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/remote.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/sso.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/index.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/redis.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/settings.html +29 -2
- nautobot/project-static/docs/user-guide/administration/configuration/time-zones.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/celery-queues.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/docker.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/health-checks.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/permissions.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/prometheus-metrics.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/replicating-nautobot.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/request-profiling.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/s3-django-storage.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/selinux-troubleshooting.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/app-install.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/external-authentication.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/http-server.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/index.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/install_system.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/nautobot.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/services.html +2 -2
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-netbox.html +2 -2
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-postgresql.html +2 -2
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-server.html +2 -2
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-shell.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/database-backup.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/after-you-upgrade.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/before-you-upgrade.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/for-developers.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/index.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/whats-changed.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/region-and-site-data-migration-guide.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/upgrading-from-nautobot-v1.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/upgrading.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuit.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittermination.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/provider.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/providernetwork.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloud.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudaccount.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetwork.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetworkprefixassignment.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudresourcetype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservice.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservicenetworkassignment.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/cable.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controller.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controllermanageddevicegroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/device.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebay.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebaytemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicefamily.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/deviceredundancygroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicetype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interface.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfaceredundancygroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfacetemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/inventoryitem.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/location.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/locationtype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/manufacturer.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/module.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebay.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebaytemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/moduletype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/platform.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerfeed.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlet.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlettemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerpanel.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rack.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackgroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackreservation.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareimagefile.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareversion.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/virtualchassis.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontext.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontextschema.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/contact.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/team.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/ipaddress.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/namespace.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/prefix.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/rir.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/routetarget.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/service.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlan.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlangroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vrf.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/overview/introduction.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenant.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenantgroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/cluster.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustergroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustertype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/virtualmachine.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/vminterface.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/contacts-and-teams.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/custom-fields.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-devices.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-location-types-and-locations.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/index.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/interfaces.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/ipam.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/platforms.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/search-bar.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/tenants.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/vlans-and-vlan-groups.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/git-data-source.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/graphql.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/ip-address-merge-tool.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/relationships.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/software-image-files-and-versions.html +2 -2
- nautobot/project-static/docs/user-guide/index.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/change-logging.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/computedfield.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/customfield.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/customlink.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/dynamicgroup.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/exporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/externalintegration.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/gitrepository.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/graphql.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/graphqlquery.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/imageattachment.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/index.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobbutton.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobhook.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/models.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/napalm.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/note.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/objectmetadata.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/relationship.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/authentication.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/filtering.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/overview.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/ui-related-endpoints.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/role.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/savedview.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/secret.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/staticgroupassociation.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/status.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/tag.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/template-filters.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/users/objectpermission.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/users/token.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/webhook.html +2 -2
- nautobot/users/admin.py +1 -1
- nautobot/users/api/serializers.py +4 -4
- nautobot/users/api/views.py +1 -1
- nautobot/virtualization/api/serializers.py +4 -4
- {nautobot-2.3.15b1.dist-info → nautobot-2.3.16.dist-info}/METADATA +5 -4
- {nautobot-2.3.15b1.dist-info → nautobot-2.3.16.dist-info}/RECORD +392 -393
- {nautobot-2.3.15b1.dist-info → nautobot-2.3.16.dist-info}/WHEEL +1 -1
- nautobot/core/fixtures/user-data.json +0 -59
- {nautobot-2.3.15b1.dist-info → nautobot-2.3.16.dist-info}/LICENSE.txt +0 -0
- {nautobot-2.3.15b1.dist-info → nautobot-2.3.16.dist-info}/NOTICE +0 -0
- {nautobot-2.3.15b1.dist-info → nautobot-2.3.16.dist-info}/entry_points.txt +0 -0
nautobot/extras/tables.py
CHANGED
|
@@ -242,7 +242,7 @@ class ConfigContextSchemaValidationStateColumn(tables.Column):
|
|
|
242
242
|
self.validator = validator
|
|
243
243
|
self.data_field = data_field
|
|
244
244
|
|
|
245
|
-
def render(self, record):
|
|
245
|
+
def render(self, *, record): # pylint: disable=arguments-differ # tables2 varies its kwargs
|
|
246
246
|
data = getattr(record, self.data_field)
|
|
247
247
|
try:
|
|
248
248
|
self.validator.validate(data)
|
|
@@ -626,13 +626,13 @@ class GitRepositoryTable(BaseTable):
|
|
|
626
626
|
)
|
|
627
627
|
|
|
628
628
|
def render_last_sync_time(self, record):
|
|
629
|
-
if record.name in self.context["job_results"]:
|
|
630
|
-
return self.context["job_results"][record.name].date_done
|
|
629
|
+
if record.name in self.context["job_results"]: # pylint: disable=no-member
|
|
630
|
+
return self.context["job_results"][record.name].date_done # pylint: disable=no-member
|
|
631
631
|
return self.default
|
|
632
632
|
|
|
633
633
|
def render_last_sync_user(self, record):
|
|
634
|
-
if record.name in self.context["job_results"]:
|
|
635
|
-
user = self.context["job_results"][record.name].user
|
|
634
|
+
if record.name in self.context["job_results"]: # pylint: disable=no-member
|
|
635
|
+
user = self.context["job_results"][record.name].user # pylint: disable=no-member
|
|
636
636
|
return user
|
|
637
637
|
return self.default
|
|
638
638
|
|
|
@@ -18,7 +18,7 @@ class APITestJob(Job):
|
|
|
18
18
|
var3 = BooleanVar()
|
|
19
19
|
var4 = ObjectVar(model=Role)
|
|
20
20
|
|
|
21
|
-
def run(self, var1, var2, var3, var4):
|
|
21
|
+
def run(self, var1, var2, var3, var4): # pylint:disable=arguments-differ
|
|
22
22
|
logger.debug(var1)
|
|
23
23
|
logger.info(var2)
|
|
24
24
|
logger.warning(var3)
|
|
@@ -19,7 +19,7 @@ class TestAtomicDecorator(Job):
|
|
|
19
19
|
fail = BooleanVar()
|
|
20
20
|
|
|
21
21
|
@transaction.atomic
|
|
22
|
-
def run(self, fail=False):
|
|
22
|
+
def run(self, fail=False): # pylint:disable=arguments-differ
|
|
23
23
|
try:
|
|
24
24
|
Status.objects.create(name="Test database atomic rollback 1")
|
|
25
25
|
if fail:
|
|
@@ -37,7 +37,7 @@ class TestAtomicContextManager(Job):
|
|
|
37
37
|
|
|
38
38
|
fail = BooleanVar()
|
|
39
39
|
|
|
40
|
-
def run(self, fail=False):
|
|
40
|
+
def run(self, fail=False): # pylint:disable=arguments-differ
|
|
41
41
|
try:
|
|
42
42
|
with transaction.atomic():
|
|
43
43
|
Status.objects.create(name="Test database atomic rollback 2")
|
|
@@ -7,7 +7,7 @@ from nautobot.extras.jobs import get_task_logger, Job, RunJobTaskFailed
|
|
|
7
7
|
logger = get_task_logger(__name__)
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class TestFailJob(Job):
|
|
11
11
|
"""
|
|
12
12
|
Job with fail result.
|
|
13
13
|
"""
|
|
@@ -15,7 +15,7 @@ class TestFail(Job):
|
|
|
15
15
|
description = "Validate job import"
|
|
16
16
|
|
|
17
17
|
def before_start(self, task_id, args, kwargs):
|
|
18
|
-
if task_id != self.request.id:
|
|
18
|
+
if task_id != self.request.id: # pylint: disable=no-member
|
|
19
19
|
raise RuntimeError(f"Expected task_id {task_id} to equal self.request.id {self.request.id}")
|
|
20
20
|
if args:
|
|
21
21
|
raise RuntimeError(f"Expected args to be empty, but it was {args!r}")
|
|
@@ -23,7 +23,7 @@ class TestFail(Job):
|
|
|
23
23
|
raise RuntimeError(f"Expected kwargs to be empty, but it was {kwargs!r}")
|
|
24
24
|
logger.info("before_start() was called as expected")
|
|
25
25
|
|
|
26
|
-
def run(self):
|
|
26
|
+
def run(self): # pylint:disable=arguments-differ
|
|
27
27
|
"""
|
|
28
28
|
Job function.
|
|
29
29
|
"""
|
|
@@ -71,7 +71,7 @@ class TestFailWithSanitization(Job):
|
|
|
71
71
|
|
|
72
72
|
description = "Validate job failure sanitization"
|
|
73
73
|
|
|
74
|
-
def run(self):
|
|
74
|
+
def run(self): # pylint:disable=arguments-differ
|
|
75
75
|
logger.info("I'm a test job that fails and sanitizes the exception!")
|
|
76
76
|
exc = RunJobTaskFailed(
|
|
77
77
|
"fatal: could not read Password for 'https://abc123@github.com': terminal prompts disabled"
|
|
@@ -91,4 +91,4 @@ class TestFailWithSanitization(Job):
|
|
|
91
91
|
raise exc
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
register_jobs(
|
|
94
|
+
register_jobs(TestFailJob, TestFailWithSanitization)
|
|
@@ -13,7 +13,7 @@ class TestFileUploadPass(Job):
|
|
|
13
13
|
description="File to upload",
|
|
14
14
|
)
|
|
15
15
|
|
|
16
|
-
def run(self, file):
|
|
16
|
+
def run(self, file): # pylint:disable=arguments-differ
|
|
17
17
|
contents = str(file.read())
|
|
18
18
|
logger.warning("File contents: %s", contents)
|
|
19
19
|
logger.info("Job didn't crash!")
|
|
@@ -39,7 +39,9 @@ class TestIPAddresses(Job):
|
|
|
39
39
|
if kwargs[expected_kwarg] is None:
|
|
40
40
|
raise RuntimeError(f"kwargs[{expected_kwarg}] is unexpectedly None!")
|
|
41
41
|
|
|
42
|
-
def run(
|
|
42
|
+
def run( # pylint:disable=arguments-differ
|
|
43
|
+
self, *, ipv4_address, ipv4_with_mask, ipv4_network, ipv6_address, ipv6_with_mask, ipv6_network
|
|
44
|
+
):
|
|
43
45
|
if not isinstance(ipv4_address, netaddr.IPAddress):
|
|
44
46
|
raise RuntimeError(f"Expected ipv4_address to be a netaddr.IPAddress, but it was {ipv4_address!r}")
|
|
45
47
|
if not isinstance(ipv4_with_mask, netaddr.IPNetwork):
|
|
@@ -15,7 +15,7 @@ class TestCreateLocationWithCustomField(Job):
|
|
|
15
15
|
name = "Location and Custom Field Creation"
|
|
16
16
|
description = "Location with a custom field"
|
|
17
17
|
|
|
18
|
-
def run(self):
|
|
18
|
+
def run(self): # pylint: disable=arguments-differ
|
|
19
19
|
with transaction.atomic():
|
|
20
20
|
obj_type = ContentType.objects.get_for_model(Location)
|
|
21
21
|
cf = CustomField(label="cf1", type=CustomFieldTypeChoices.TYPE_TEXT, default="-")
|
|
@@ -8,7 +8,7 @@ class TestLogRedaction(Job):
|
|
|
8
8
|
class Meta:
|
|
9
9
|
description = "Test redaction of logs"
|
|
10
10
|
|
|
11
|
-
def run(self):
|
|
11
|
+
def run(self): # pylint: disable=arguments-differ
|
|
12
12
|
logger.debug("The secret is supersecret123")
|
|
13
13
|
logger.info("The secret is supersecret123")
|
|
14
14
|
logger.warning("The secret is supersecret123")
|
|
@@ -8,7 +8,7 @@ class TestLogSkipDBLogging(Job):
|
|
|
8
8
|
class Meta:
|
|
9
9
|
description = "Test logs not being saved to the database"
|
|
10
10
|
|
|
11
|
-
def run(self):
|
|
11
|
+
def run(self): # pylint: disable=arguments-differ
|
|
12
12
|
logger.debug("I should NOT be logged to the database", extra={"skip_db_logging": True})
|
|
13
13
|
logger.info("I should be logged to the database")
|
|
14
14
|
|
|
@@ -12,7 +12,7 @@ class TestOptionalObjectVar(Job):
|
|
|
12
12
|
required=False,
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
-
def run(self, location=None):
|
|
15
|
+
def run(self, location=None): # pylint: disable=arguments-differ
|
|
16
16
|
logger.info("The Location if any that the user provided.", extra={"object": location})
|
|
17
17
|
return "Nice Location (or not)!"
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ class TestRequiredObjectVar(Job):
|
|
|
12
12
|
required=True,
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
-
def run(self, location):
|
|
15
|
+
def run(self, location): # pylint: disable=arguments-differ
|
|
16
16
|
logger.info("The Location that the user provided.", extra={"object": location})
|
|
17
17
|
return "Nice Location!"
|
|
18
18
|
|
|
@@ -13,7 +13,7 @@ class TestObjectVars(Job):
|
|
|
13
13
|
role = ObjectVar(model=Role)
|
|
14
14
|
roles = MultiObjectVar(model=Role)
|
|
15
15
|
|
|
16
|
-
def run(self, role, roles):
|
|
16
|
+
def run(self, role, roles): # pylint: disable=arguments-differ
|
|
17
17
|
logger.info("Role: %s", role)
|
|
18
18
|
logger.warning("Roles: %s", roles)
|
|
19
19
|
|
|
@@ -5,7 +5,7 @@ from nautobot.extras.jobs import get_task_logger, Job
|
|
|
5
5
|
logger = get_task_logger(__name__)
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class
|
|
8
|
+
class TestPassJob(Job):
|
|
9
9
|
"""
|
|
10
10
|
Job with pass result.
|
|
11
11
|
"""
|
|
@@ -24,7 +24,7 @@ class TestPass(Job):
|
|
|
24
24
|
raise RuntimeError(f"Expected kwargs to be empty, but it was {kwargs!r}")
|
|
25
25
|
logger.info("before_start() was called as expected")
|
|
26
26
|
|
|
27
|
-
def run(self):
|
|
27
|
+
def run(self): # pylint: disable=arguments-differ
|
|
28
28
|
"""
|
|
29
29
|
Job function.
|
|
30
30
|
"""
|
|
@@ -61,4 +61,4 @@ class TestPass(Job):
|
|
|
61
61
|
logger.info("after_return() was called as expected")
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
register_jobs(
|
|
64
|
+
register_jobs(TestPassJob)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from fail import
|
|
1
|
+
from fail import TestFailJob # pylint: disable=import-error
|
|
2
2
|
|
|
3
3
|
from nautobot.apps.jobs import register_jobs
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class TestReallyPass(
|
|
7
|
-
def run(self):
|
|
6
|
+
class TestReallyPass(TestFailJob):
|
|
7
|
+
def run(self): # pylint: disable=arguments-differ
|
|
8
8
|
pass
|
|
9
9
|
|
|
10
10
|
|
|
@@ -4,8 +4,6 @@ from nautobot.core.testing.integration import SeleniumTestCase
|
|
|
4
4
|
class PluginBannerTestCase(SeleniumTestCase):
|
|
5
5
|
"""Integration test for rendering of plugin-injected banner content."""
|
|
6
6
|
|
|
7
|
-
fixtures = ("user-data",)
|
|
8
|
-
|
|
9
7
|
def test_banner_not_rendered(self):
|
|
10
8
|
"""As implemented, plugin banner does not render if the user is not logged in.
|
|
11
9
|
|
|
@@ -1535,10 +1535,10 @@ class JobTest(
|
|
|
1535
1535
|
self.assertHttpStatus(response, status.HTTP_404_NOT_FOUND)
|
|
1536
1536
|
|
|
1537
1537
|
# Try post to permitted job
|
|
1538
|
-
job_model = Job.objects.get_for_class_path("pass.
|
|
1538
|
+
job_model = Job.objects.get_for_class_path("pass.TestPassJob")
|
|
1539
1539
|
job_model.enabled = True
|
|
1540
1540
|
job_model.validated_save()
|
|
1541
|
-
url = self.get_run_url("pass.
|
|
1541
|
+
url = self.get_run_url("pass.TestPassJob")
|
|
1542
1542
|
response = self.client.post(url, **self.header)
|
|
1543
1543
|
self.assertHttpStatus(response, self.run_success_response_status)
|
|
1544
1544
|
|
|
@@ -2091,10 +2091,10 @@ class JobTest(
|
|
|
2091
2091
|
"task_queue": settings.CELERY_TASK_DEFAULT_QUEUE,
|
|
2092
2092
|
}
|
|
2093
2093
|
|
|
2094
|
-
job_model = Job.objects.get_for_class_path("pass.
|
|
2094
|
+
job_model = Job.objects.get_for_class_path("pass.TestPassJob")
|
|
2095
2095
|
job_model.enabled = True
|
|
2096
2096
|
job_model.validated_save()
|
|
2097
|
-
url = self.get_run_url("pass.
|
|
2097
|
+
url = self.get_run_url("pass.TestPassJob")
|
|
2098
2098
|
response = self.client.post(url, data, format="json", **self.header)
|
|
2099
2099
|
self.assertHttpStatus(response, self.run_success_response_status)
|
|
2100
2100
|
|
|
@@ -2465,10 +2465,10 @@ class ScheduledJobTest(
|
|
|
2465
2465
|
@classmethod
|
|
2466
2466
|
def setUpTestData(cls):
|
|
2467
2467
|
user = User.objects.create(username="user1", is_active=True)
|
|
2468
|
-
job_model = Job.objects.get_for_class_path("pass.
|
|
2468
|
+
job_model = Job.objects.get_for_class_path("pass.TestPassJob")
|
|
2469
2469
|
ScheduledJob.objects.create(
|
|
2470
2470
|
name="test1",
|
|
2471
|
-
task="pass.
|
|
2471
|
+
task="pass.TestPassJob",
|
|
2472
2472
|
job_model=job_model,
|
|
2473
2473
|
interval=JobExecutionType.TYPE_IMMEDIATELY,
|
|
2474
2474
|
user=user,
|
|
@@ -2477,7 +2477,7 @@ class ScheduledJobTest(
|
|
|
2477
2477
|
)
|
|
2478
2478
|
ScheduledJob.objects.create(
|
|
2479
2479
|
name="test2",
|
|
2480
|
-
task="pass.
|
|
2480
|
+
task="pass.TestPassJob",
|
|
2481
2481
|
job_model=job_model,
|
|
2482
2482
|
interval=JobExecutionType.TYPE_DAILY,
|
|
2483
2483
|
user=user,
|
|
@@ -2487,7 +2487,7 @@ class ScheduledJobTest(
|
|
|
2487
2487
|
)
|
|
2488
2488
|
ScheduledJob.objects.create(
|
|
2489
2489
|
name="test3",
|
|
2490
|
-
task="pass.
|
|
2490
|
+
task="pass.TestPassJob",
|
|
2491
2491
|
job_model=job_model,
|
|
2492
2492
|
interval=JobExecutionType.TYPE_CUSTOM,
|
|
2493
2493
|
crontab="34 12 * * *",
|
|
@@ -2502,12 +2502,12 @@ class JobApprovalTest(APITestCase):
|
|
|
2502
2502
|
@classmethod
|
|
2503
2503
|
def setUpTestData(cls):
|
|
2504
2504
|
cls.additional_user = User.objects.create(username="user1", is_active=True)
|
|
2505
|
-
cls.job_model = Job.objects.get_for_class_path("pass.
|
|
2505
|
+
cls.job_model = Job.objects.get_for_class_path("pass.TestPassJob")
|
|
2506
2506
|
cls.job_model.enabled = True
|
|
2507
2507
|
cls.job_model.save()
|
|
2508
2508
|
cls.scheduled_job = ScheduledJob.objects.create(
|
|
2509
2509
|
name="test pass",
|
|
2510
|
-
task="pass.
|
|
2510
|
+
task="pass.TestPassJob",
|
|
2511
2511
|
job_model=cls.job_model,
|
|
2512
2512
|
interval=JobExecutionType.TYPE_IMMEDIATELY,
|
|
2513
2513
|
user=cls.additional_user,
|
|
@@ -2560,7 +2560,7 @@ class JobApprovalTest(APITestCase):
|
|
|
2560
2560
|
self.add_permissions("extras.approve_job", "extras.view_scheduledjob", "extras.change_scheduledjob")
|
|
2561
2561
|
scheduled_job = ScheduledJob.objects.create(
|
|
2562
2562
|
name="test",
|
|
2563
|
-
task="pass.
|
|
2563
|
+
task="pass.TestPassJob",
|
|
2564
2564
|
job_model=self.job_model,
|
|
2565
2565
|
interval=JobExecutionType.TYPE_IMMEDIATELY,
|
|
2566
2566
|
user=self.user,
|
|
@@ -2583,7 +2583,7 @@ class JobApprovalTest(APITestCase):
|
|
|
2583
2583
|
self.add_permissions("extras.approve_job", "extras.view_scheduledjob", "extras.change_scheduledjob")
|
|
2584
2584
|
scheduled_job = ScheduledJob.objects.create(
|
|
2585
2585
|
name="test",
|
|
2586
|
-
task="pass.
|
|
2586
|
+
task="pass.TestPassJob",
|
|
2587
2587
|
job_model=self.job_model,
|
|
2588
2588
|
interval=JobExecutionType.TYPE_FUTURE,
|
|
2589
2589
|
one_off=True,
|
|
@@ -2600,7 +2600,7 @@ class JobApprovalTest(APITestCase):
|
|
|
2600
2600
|
self.add_permissions("extras.approve_job", "extras.view_scheduledjob", "extras.change_scheduledjob")
|
|
2601
2601
|
scheduled_job = ScheduledJob.objects.create(
|
|
2602
2602
|
name="test",
|
|
2603
|
-
task="pass.
|
|
2603
|
+
task="pass.TestPassJob",
|
|
2604
2604
|
job_model=self.job_model,
|
|
2605
2605
|
interval=JobExecutionType.TYPE_FUTURE,
|
|
2606
2606
|
one_off=True,
|
|
@@ -2240,7 +2240,7 @@ class CustomFieldTableTest(TestCase):
|
|
|
2240
2240
|
self.assertIsNotNone(custom_column, internal_col_name)
|
|
2241
2241
|
self.assertIsInstance(custom_column, CustomFieldColumn)
|
|
2242
2242
|
|
|
2243
|
-
rendered_value = bound_row.get_cell(internal_col_name)
|
|
2243
|
+
rendered_value = bound_row.get_cell(internal_col_name) # pylint: disable=no-member
|
|
2244
2244
|
self.assertEqual(rendered_value, col_expected_value)
|
|
2245
2245
|
|
|
2246
2246
|
|
|
@@ -285,7 +285,8 @@ class GitTest(TransactionTestCase):
|
|
|
285
285
|
|
|
286
286
|
self.repo.secrets_group = secrets_group
|
|
287
287
|
self.repo.remote_url = "http://localhost/git.git"
|
|
288
|
-
|
|
288
|
+
# avoid failing due to lack of jobs module
|
|
289
|
+
self.repo.provided_contents.remove("extras.job") # pylint: disable=no-member
|
|
289
290
|
self.repo.save()
|
|
290
291
|
|
|
291
292
|
self.mock_request.id = uuid.uuid4()
|
|
@@ -587,7 +587,7 @@ class DynamicGroupModelTest(DynamicGroupTestBase): # TODO: BaseModelTestCase mi
|
|
|
587
587
|
"""
|
|
588
588
|
pfx_content_type = ContentType.objects.get_for_model(Prefix)
|
|
589
589
|
group = DynamicGroup(name="pfx", content_type=pfx_content_type)
|
|
590
|
-
filterset = group.filterset_class()
|
|
590
|
+
filterset = group.filterset_class() # pylint: disable=not-callable # should not be None here!
|
|
591
591
|
fields = group._map_filter_fields
|
|
592
592
|
|
|
593
593
|
# We know that `within_include` does not have a `generate_query_{filter_method}` method.
|
|
@@ -1078,11 +1078,11 @@ class JobFilterSetTestCase(FilterTestCases.NameOnlyFilterTestCase):
|
|
|
1078
1078
|
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
|
1079
1079
|
|
|
1080
1080
|
def test_installed(self):
|
|
1081
|
-
params = {"job_class_name": "
|
|
1081
|
+
params = {"job_class_name": "TestPassJob", "installed": True}
|
|
1082
1082
|
self.assertTrue(self.filterset(params, self.queryset).qs.exists())
|
|
1083
1083
|
|
|
1084
1084
|
def test_enabled(self):
|
|
1085
|
-
params = {"job_class_name": "
|
|
1085
|
+
params = {"job_class_name": "TestPassJob", "enabled": False}
|
|
1086
1086
|
self.assertTrue(self.filterset(params, self.queryset).qs.exists())
|
|
1087
1087
|
|
|
1088
1088
|
def test_dryrun_default(self):
|
|
@@ -1134,11 +1134,11 @@ class JobResultFilterSetTestCase(FilterTestCases.FilterTestCase):
|
|
|
1134
1134
|
jobs = Job.objects.all()[:3]
|
|
1135
1135
|
cls.jobs = jobs
|
|
1136
1136
|
user = User.objects.create(username="user1", is_active=True)
|
|
1137
|
-
job_model = Job.objects.get_for_class_path("pass.
|
|
1137
|
+
job_model = Job.objects.get_for_class_path("pass.TestPassJob")
|
|
1138
1138
|
scheduled_jobs = [
|
|
1139
1139
|
ScheduledJob.objects.create(
|
|
1140
1140
|
name="test1",
|
|
1141
|
-
task="pass.
|
|
1141
|
+
task="pass.TestPassJob",
|
|
1142
1142
|
job_model=job_model,
|
|
1143
1143
|
interval=JobExecutionType.TYPE_IMMEDIATELY,
|
|
1144
1144
|
user=user,
|
|
@@ -1147,7 +1147,7 @@ class JobResultFilterSetTestCase(FilterTestCases.FilterTestCase):
|
|
|
1147
1147
|
),
|
|
1148
1148
|
ScheduledJob.objects.create(
|
|
1149
1149
|
name="test2",
|
|
1150
|
-
task="pass.
|
|
1150
|
+
task="pass.TestPassJob",
|
|
1151
1151
|
job_model=job_model,
|
|
1152
1152
|
interval=JobExecutionType.TYPE_DAILY,
|
|
1153
1153
|
user=user,
|
|
@@ -1157,7 +1157,7 @@ class JobResultFilterSetTestCase(FilterTestCases.FilterTestCase):
|
|
|
1157
1157
|
),
|
|
1158
1158
|
ScheduledJob.objects.create(
|
|
1159
1159
|
name="test3",
|
|
1160
|
-
task="pass.
|
|
1160
|
+
task="pass.TestPassJob",
|
|
1161
1161
|
job_model=job_model,
|
|
1162
1162
|
interval=JobExecutionType.TYPE_CUSTOM,
|
|
1163
1163
|
crontab="34 12 * * *",
|
|
@@ -4,12 +4,13 @@ import warnings
|
|
|
4
4
|
from django.contrib.auth import get_user_model
|
|
5
5
|
from django.contrib.contenttypes.models import ContentType
|
|
6
6
|
from django.db.models import Q
|
|
7
|
+
from django.forms import ChoiceField, MultipleChoiceField
|
|
7
8
|
from django.test import override_settings, TestCase
|
|
8
9
|
|
|
9
10
|
from nautobot.dcim.forms import DeviceForm, LocationBulkEditForm, LocationForm
|
|
10
11
|
import nautobot.dcim.models as dcim_models
|
|
11
12
|
from nautobot.dcim.models import Device, Location, LocationType
|
|
12
|
-
from nautobot.extras.choices import RelationshipTypeChoices
|
|
13
|
+
from nautobot.extras.choices import CustomFieldTypeChoices, RelationshipTypeChoices
|
|
13
14
|
from nautobot.extras.forms import (
|
|
14
15
|
ConfigContextFilterForm,
|
|
15
16
|
ConfigContextForm,
|
|
@@ -25,6 +26,7 @@ from nautobot.extras.forms import (
|
|
|
25
26
|
WebhookForm,
|
|
26
27
|
)
|
|
27
28
|
from nautobot.extras.models import (
|
|
29
|
+
CustomField,
|
|
28
30
|
Job,
|
|
29
31
|
JobButton,
|
|
30
32
|
JobHook,
|
|
@@ -1217,3 +1219,20 @@ class CustomFieldModelFormMixinTestCase(TestCase):
|
|
|
1217
1219
|
|
|
1218
1220
|
custom_field_form = TestForm()
|
|
1219
1221
|
self.assertIn("_custom_field_data", custom_field_form.fields)
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
class CustomFieldTestCase(TestCase):
|
|
1225
|
+
def test_to_form_field_type_select(self):
|
|
1226
|
+
"""Verify that `to_form_field` and `to_filter_form_field` return the correct field types for a select-type CustomField."""
|
|
1227
|
+
custom_field = CustomField.objects.create(
|
|
1228
|
+
type=CustomFieldTypeChoices.TYPE_SELECT,
|
|
1229
|
+
label="Custom Field Select",
|
|
1230
|
+
)
|
|
1231
|
+
form = custom_field.to_filter_form_field()
|
|
1232
|
+
self.assertIsInstance(form, MultipleChoiceField)
|
|
1233
|
+
|
|
1234
|
+
form = custom_field.to_form_field(for_filter_form=True)
|
|
1235
|
+
self.assertIsInstance(form, MultipleChoiceField)
|
|
1236
|
+
|
|
1237
|
+
form = custom_field.to_form_field(for_filter_form=False)
|
|
1238
|
+
self.assertIsInstance(form, ChoiceField)
|
|
@@ -170,7 +170,7 @@ class JobTest(TestCase):
|
|
|
170
170
|
self.assertTrue(job_model.supports_dryrun)
|
|
171
171
|
|
|
172
172
|
module = "pass"
|
|
173
|
-
name = "
|
|
173
|
+
name = "TestPassJob"
|
|
174
174
|
job_class, job_model = get_job_class_and_model(module, name)
|
|
175
175
|
self.assertFalse(job_class.supports_dryrun)
|
|
176
176
|
self.assertFalse(job_model.supports_dryrun)
|
|
@@ -212,7 +212,7 @@ register_jobs(MyJob)
|
|
|
212
212
|
self.assertIsNotNone(get_job("my_jobs.MyJob"))
|
|
213
213
|
# Also make sure some representative previous JOBS_ROOT jobs aren't still around:
|
|
214
214
|
self.assertNotIn("dry_run.TestDryRun", jobs_data.keys())
|
|
215
|
-
self.assertNotIn("pass.
|
|
215
|
+
self.assertNotIn("pass.TestPassJob", jobs_data.keys())
|
|
216
216
|
|
|
217
217
|
# Create a second Job in the same module
|
|
218
218
|
with open(os.path.join(temp_dir, "my_jobs.py"), "a") as fd:
|
|
@@ -319,7 +319,7 @@ class JobTransactionTest(TransactionTestCase):
|
|
|
319
319
|
Job test with pass result.
|
|
320
320
|
"""
|
|
321
321
|
module = "pass"
|
|
322
|
-
name = "
|
|
322
|
+
name = "TestPassJob"
|
|
323
323
|
job_result = create_job_result_and_run_job(module, name)
|
|
324
324
|
self.assertEqual(job_result.status, JobResultStatusChoices.STATUS_SUCCESS)
|
|
325
325
|
self.assertEqual(job_result.result, True)
|
|
@@ -353,7 +353,7 @@ class JobTransactionTest(TransactionTestCase):
|
|
|
353
353
|
Job test with fail result.
|
|
354
354
|
"""
|
|
355
355
|
module = "fail"
|
|
356
|
-
name = "
|
|
356
|
+
name = "TestFailJob"
|
|
357
357
|
job_result = create_job_result_and_run_job(module, name)
|
|
358
358
|
self.assertEqual(job_result.status, JobResultStatusChoices.STATUS_FAILURE)
|
|
359
359
|
logs = job_result.job_log_entries
|
|
@@ -588,7 +588,7 @@ class JobTransactionTest(TransactionTestCase):
|
|
|
588
588
|
Job test to see if the latest_result property is indeed returning the most recent job result
|
|
589
589
|
"""
|
|
590
590
|
module = "pass"
|
|
591
|
-
name = "
|
|
591
|
+
name = "TestPassJob"
|
|
592
592
|
job_result_1 = create_job_result_and_run_job(module, name)
|
|
593
593
|
self.assertEqual(job_result_1.status, JobResultStatusChoices.STATUS_SUCCESS)
|
|
594
594
|
job_result_2 = create_job_result_and_run_job(module, name)
|
|
@@ -803,7 +803,7 @@ class RunJobManagementCommandTest(TransactionTestCase):
|
|
|
803
803
|
def test_runjob_nochange_successful(self):
|
|
804
804
|
"""Basic success-path test for Jobs that don't modify the Nautobot database."""
|
|
805
805
|
module = "pass"
|
|
806
|
-
name = "
|
|
806
|
+
name = "TestPassJob"
|
|
807
807
|
_job_class, job_model = get_job_class_and_model(module, name)
|
|
808
808
|
|
|
809
809
|
out, err = self.run_command("--local", "--no-color", "--username", self.user.username, job_model.class_path)
|
|
@@ -903,7 +903,7 @@ class JobButtonReceiverTest(TestCase):
|
|
|
903
903
|
def test_is_job_button(self):
|
|
904
904
|
with self.subTest(expected=False):
|
|
905
905
|
module = "pass"
|
|
906
|
-
name = "
|
|
906
|
+
name = "TestPassJob"
|
|
907
907
|
_job_class, job_model = get_job_class_and_model(module, name)
|
|
908
908
|
self.assertFalse(job_model.is_job_button_receiver)
|
|
909
909
|
|
|
@@ -966,7 +966,7 @@ class JobHookReceiverTest(TestCase):
|
|
|
966
966
|
def test_is_job_hook(self):
|
|
967
967
|
with self.subTest(expected=False):
|
|
968
968
|
module = "pass"
|
|
969
|
-
name = "
|
|
969
|
+
name = "TestPassJob"
|
|
970
970
|
_job_class, job_model = get_job_class_and_model(module, name)
|
|
971
971
|
self.assertFalse(job_model.is_job_hook_receiver)
|
|
972
972
|
|
|
@@ -1127,7 +1127,7 @@ class RemoveScheduledJobManagementCommandTestCase(TestCase):
|
|
|
1127
1127
|
for i in range(1, 7):
|
|
1128
1128
|
models.ScheduledJob.objects.create(
|
|
1129
1129
|
name=f"test{i}",
|
|
1130
|
-
task="pass.
|
|
1130
|
+
task="pass.TestPassJob",
|
|
1131
1131
|
interval=JobExecutionType.TYPE_FUTURE,
|
|
1132
1132
|
user=self.user,
|
|
1133
1133
|
start_time=timezone.now() - datetime.timedelta(days=i * 30),
|
|
@@ -1136,7 +1136,7 @@ class RemoveScheduledJobManagementCommandTestCase(TestCase):
|
|
|
1136
1136
|
|
|
1137
1137
|
models.ScheduledJob.objects.create(
|
|
1138
1138
|
name="test7",
|
|
1139
|
-
task="pass.
|
|
1139
|
+
task="pass.TestPassJob",
|
|
1140
1140
|
interval=JobExecutionType.TYPE_DAILY,
|
|
1141
1141
|
user=self.user,
|
|
1142
1142
|
start_time=timezone.now() - datetime.timedelta(days=180),
|
|
@@ -1164,7 +1164,7 @@ class ScheduledJobIntervalTestCase(TestCase):
|
|
|
1164
1164
|
start_time = timezone.now() + datetime.timedelta(days=6)
|
|
1165
1165
|
scheduled_job = models.ScheduledJob.objects.create(
|
|
1166
1166
|
name="weekly_interval",
|
|
1167
|
-
task="pass.
|
|
1167
|
+
task="pass.TestPassJob",
|
|
1168
1168
|
interval=JobExecutionType.TYPE_WEEKLY,
|
|
1169
1169
|
user=self.user,
|
|
1170
1170
|
start_time=start_time,
|