Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F25005528
D4028.id10525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
19 KB
Referenced Files
None
Subscribers
None
D4028.id10525.diff
View Options
diff --git a/_modules/convert.py b/_modules/convert.py
--- a/_modules/convert.py
+++ b/_modules/convert.py
@@ -9,11 +9,9 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import json
import salt.serializers.yaml
-
# -------------------------------------------------------------
# JSON
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/_modules/credentials.py b/_modules/credentials.py
--- a/_modules/credentials.py
+++ b/_modules/credentials.py
@@ -14,7 +14,6 @@
from salt.utils.files import fopen
-
VAULT_PREFIX = "ops/secrets/"
diff --git a/_modules/network_utils.py b/_modules/network_utils.py
--- a/_modules/network_utils.py
+++ b/_modules/network_utils.py
@@ -7,11 +7,9 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import ipaddress
import re
-
# -------------------------------------------------------------
# CIDR netmask and prefixes
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/_modules/node.py b/_modules/node.py
--- a/_modules/node.py
+++ b/_modules/node.py
@@ -9,12 +9,10 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
from salt.exceptions import CommandExecutionError, SaltCloudConfigError
from salt._compat import ipaddress
from collections import OrderedDict
-
DEPLOY_ROLES = [
"devserver",
"salt-primary",
diff --git a/_modules/rabbitmq_api.py b/_modules/rabbitmq_api.py
--- a/_modules/rabbitmq_api.py
+++ b/_modules/rabbitmq_api.py
@@ -8,7 +8,6 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import base64
import hashlib
import json
@@ -18,7 +17,6 @@
import requests
from requests.auth import HTTPBasicAuth
-
log = logging.getLogger(__name__)
diff --git a/_states/rabbitmq.py b/_states/rabbitmq.py
--- a/_states/rabbitmq.py
+++ b/_states/rabbitmq.py
@@ -8,10 +8,8 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import logging
-
log = logging.getLogger(__name__)
diff --git a/_tests/helpers.py b/_tests/helpers.py
--- a/_tests/helpers.py
+++ b/_tests/helpers.py
@@ -7,7 +7,6 @@
# Reference: http://docs.python.org/3/library/importlib.html
# -------------------------------------------------------------
-
import importlib.util
import os
import sys
@@ -15,7 +14,6 @@
import yaml
-
# -------------------------------------------------------------
# Import mechanics
#
diff --git a/_tests/modules/test_nano.py b/_tests/modules/test_nano.py
--- a/_tests/modules/test_nano.py
+++ b/_tests/modules/test_nano.py
@@ -5,7 +5,6 @@
import salt_test_case
import nano
-
DATA_DIR = "data/nanorc_dir"
EXPECTED_INCLUDES = [
"include data/nanorc_dir/bar.nanorc",
diff --git a/_tests/pillar/core/test_users.py b/_tests/pillar/core/test_users.py
--- a/_tests/pillar/core/test_users.py
+++ b/_tests/pillar/core/test_users.py
@@ -3,7 +3,6 @@
import unittest
import yaml
-
PILLAR_FILE = "../pillar/core/users.sls"
USER_PROPERTIES_MANDATORY = set(
diff --git a/_tests/pillar/credentials/test_vault.py b/_tests/pillar/credentials/test_vault.py
--- a/_tests/pillar/credentials/test_vault.py
+++ b/_tests/pillar/credentials/test_vault.py
@@ -5,7 +5,6 @@
import unittest
import yaml
-
PILLAR_FILE = "../pillar/credentials/vault.sls"
diff --git a/_tests/pillar/dbserver/test_postgresql.py b/_tests/pillar/dbserver/test_postgresql.py
--- a/_tests/pillar/dbserver/test_postgresql.py
+++ b/_tests/pillar/dbserver/test_postgresql.py
@@ -8,13 +8,11 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import unittest
from unittest_data_provider import data_provider
from helpers import load_pillars
-
# -------------------------------------------------------------
# Connection keys
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/_tests/pillar/paas/test_docker.py b/_tests/pillar/paas/test_docker.py
--- a/_tests/pillar/paas/test_docker.py
+++ b/_tests/pillar/paas/test_docker.py
@@ -5,7 +5,6 @@
import unittest
import yaml
-
PILLAR_PATH = "../pillar/paas/docker/"
diff --git a/_tests/roles/python/dns/test_dns_zones.py b/_tests/roles/python/dns/test_dns_zones.py
--- a/_tests/roles/python/dns/test_dns_zones.py
+++ b/_tests/roles/python/dns/test_dns_zones.py
@@ -8,7 +8,6 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import os
import subprocess
import sys
@@ -21,7 +20,6 @@
from helpers import load_pillars
-
# -------------------------------------------------------------
# Does zone file exist?
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/_tests/scripts/python/test_clear_video_queue.py b/_tests/scripts/python/test_clear_video_queue.py
--- a/_tests/scripts/python/test_clear_video_queue.py
+++ b/_tests/scripts/python/test_clear_video_queue.py
@@ -4,7 +4,6 @@
from helpers import import_from_path
-
script_path = "roles/paas-docker/containers/files/mastodon/clear-video-queue.py"
script = import_from_path("script", script_path)
diff --git a/_tests/scripts/python/test_edit_acme_dns_accounts.py b/_tests/scripts/python/test_edit_acme_dns_accounts.py
--- a/_tests/scripts/python/test_edit_acme_dns_accounts.py
+++ b/_tests/scripts/python/test_edit_acme_dns_accounts.py
@@ -1,12 +1,10 @@
#!/usr/bin/env python3
-
import os
import unittest
from helpers import import_from_path
-
script_path = "roles/core/certificates/files/certbot/acme-dns/edit-acme-dns-accounts.py"
script = import_from_path("script", script_path)
diff --git a/roles/core/certificates/files/certbot/utilities/check-letsencrypt-certificates.py b/roles/core/certificates/files/certbot/utilities/check-letsencrypt-certificates.py
--- a/roles/core/certificates/files/certbot/utilities/check-letsencrypt-certificates.py
+++ b/roles/core/certificates/files/certbot/utilities/check-letsencrypt-certificates.py
@@ -28,14 +28,12 @@
#
# -------------------------------------------------------------
-
import os
import random
import string
from urllib.error import HTTPError
from urllib.request import urlopen
-
# -------------------------------------------------------------
# Configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/dbserver-pgsql/monitoring/files/check-postgresql-dependencies.py b/roles/dbserver-pgsql/monitoring/files/check-postgresql-dependencies.py
--- a/roles/dbserver-pgsql/monitoring/files/check-postgresql-dependencies.py
+++ b/roles/dbserver-pgsql/monitoring/files/check-postgresql-dependencies.py
@@ -9,12 +9,10 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import distutils.spawn
import lddcollect
import sys
-
# -------------------------------------------------------------
# Dependencies
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/dbserver-pgsql/monitoring/files/check-postgresql-xml-support.py b/roles/dbserver-pgsql/monitoring/files/check-postgresql-xml-support.py
--- a/roles/dbserver-pgsql/monitoring/files/check-postgresql-xml-support.py
+++ b/roles/dbserver-pgsql/monitoring/files/check-postgresql-xml-support.py
@@ -8,12 +8,10 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import distutils.spawn
import lddcollect
import sys
-
# -------------------------------------------------------------
# Dependencies
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/devserver/api-exec/files/server.py b/roles/devserver/api-exec/files/server.py
--- a/roles/devserver/api-exec/files/server.py
+++ b/roles/devserver/api-exec/files/server.py
@@ -16,7 +16,6 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-
import os
import subprocess
import sys
@@ -24,7 +23,6 @@
from flask import Flask, Response, abort
import yaml
-
# -------------------------------------------------------------
# Parse configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/devserver/userland-software/files/ccache-metrics.py b/roles/devserver/userland-software/files/ccache-metrics.py
--- a/roles/devserver/userland-software/files/ccache-metrics.py
+++ b/roles/devserver/userland-software/files/ccache-metrics.py
@@ -16,17 +16,14 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-
from datetime import datetime
import re
import subprocess
import time
-
CCACHE_DATE_FORMAT = "%a %b %d %H:%M:%S %Y"
PREFIX = "ccache"
-
# -------------------------------------------------------------
# OpenMetrics
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -39,7 +36,7 @@
if not key.endswith("_info"):
metric_key += "_info"
- metric_key += "{path=\"" + value + "\"}"
+ metric_key += '{path="' + value + '"}'
type = "info"
value = 1
elif key.endswith("_rate") or key.endswith("_size") or key == "files_in_cache":
diff --git a/roles/devserver/userland-software/files/install-clang-format-alias.py b/roles/devserver/userland-software/files/install-clang-format-alias.py
--- a/roles/devserver/userland-software/files/install-clang-format-alias.py
+++ b/roles/devserver/userland-software/files/install-clang-format-alias.py
@@ -8,12 +8,10 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
from glob import glob
import os
import sys
-
# -------------------------------------------------------------
# Create clang-format alias
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/devserver/userland-software/files/shell.py b/roles/devserver/userland-software/files/shell.py
--- a/roles/devserver/userland-software/files/shell.py
+++ b/roles/devserver/userland-software/files/shell.py
@@ -25,7 +25,6 @@
import sys
import yaml
-
# -------------------------------------------------------------
# Configuration file locator
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/devserver/userland-software/files/url.py b/roles/devserver/userland-software/files/url.py
--- a/roles/devserver/userland-software/files/url.py
+++ b/roles/devserver/userland-software/files/url.py
@@ -17,13 +17,11 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-
import platform
import os
import sys
import yaml
-
# -------------------------------------------------------------
# Exceptions
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/devserver/webserver-home/files/setup-web-home.py b/roles/devserver/webserver-home/files/setup-web-home.py
--- a/roles/devserver/webserver-home/files/setup-web-home.py
+++ b/roles/devserver/webserver-home/files/setup-web-home.py
@@ -8,11 +8,9 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import os
import sys
-
# -------------------------------------------------------------
# Web setup
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/mailserver/postfix/files/postfix-to-mailman.py b/roles/mailserver/postfix/files/postfix-to-mailman.py
--- a/roles/mailserver/postfix/files/postfix-to-mailman.py
+++ b/roles/mailserver/postfix/files/postfix-to-mailman.py
@@ -34,13 +34,11 @@
# configuration variables, above.
# -------------------------------------------------------------
-
import os
import sys
import re
import string
-
# -------------------------------------------------------------
# Configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/monitoring/checks/files/check-github-storage.py b/roles/monitoring/checks/files/check-github-storage.py
--- a/roles/monitoring/checks/files/check-github-storage.py
+++ b/roles/monitoring/checks/files/check-github-storage.py
@@ -8,18 +8,15 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import hvac
import requests
import yaml
-
VAULT_CERTIFICATE = "/usr/local/share/certs/nasqueron-vault-ca.crt"
ORG = "nasqueron"
STORAGE_THRESHOLD = 8
-
# -------------------------------------------------------------
# Configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/paas-docker/containers/files/hound/generate-config.py b/roles/paas-docker/containers/files/hound/generate-config.py
--- a/roles/paas-docker/containers/files/hound/generate-config.py
+++ b/roles/paas-docker/containers/files/hound/generate-config.py
@@ -1,13 +1,10 @@
#!/usr/bin/env python3
-
import json
import sys
-
POLL_TIME = 3600000
-
# -------------------------------------------------------------
# Configuration methods
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/paas-docker/containers/files/mastodon/clear-video-queue.py b/roles/paas-docker/containers/files/mastodon/clear-video-queue.py
--- a/roles/paas-docker/containers/files/mastodon/clear-video-queue.py
+++ b/roles/paas-docker/containers/files/mastodon/clear-video-queue.py
@@ -16,10 +16,8 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-
import subprocess
-
PS_COLUMN_PID = 0
PS_COLUMN_TIME = 3
PS_COLUMN_COMMAND = 4
diff --git a/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py b/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py
--- a/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py
+++ b/roles/paas-docker/containers/files/sentry/etc/sentry.conf.py
@@ -14,12 +14,10 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-
import hvac
from sentry.conf.server import * # NOQA
-
# -------------------------------------------------------------
# Helper methods
#
diff --git a/roles/paas-docker/docker/files/docker-paas-list-containers.py b/roles/paas-docker/docker/files/docker-paas-list-containers.py
--- a/roles/paas-docker/docker/files/docker-paas-list-containers.py
+++ b/roles/paas-docker/docker/files/docker-paas-list-containers.py
@@ -14,16 +14,13 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
from graphlib import TopologicalSorter
import json
import subprocess
import sys
-
CONTAINER_DELIMITERS = [":"]
-
# -------------------------------------------------------------
# Resolve dependencies
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/dump-py-state.py b/utils/dump-py-state.py
--- a/utils/dump-py-state.py
+++ b/utils/dump-py-state.py
@@ -10,13 +10,11 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import os
import subprocess
import sys
import yaml
-
# -------------------------------------------------------------
# Pillar helper
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/migrate-ssh-keys.py b/utils/migrate-ssh-keys.py
--- a/utils/migrate-ssh-keys.py
+++ b/utils/migrate-ssh-keys.py
@@ -22,11 +22,9 @@
#
# -------------------------------------------------------------
-
import os
import yaml
-
# -------------------------------------------------------------
# Configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/netbox/build-etc-hosts-drake.py b/utils/netbox/build-etc-hosts-drake.py
--- a/utils/netbox/build-etc-hosts-drake.py
+++ b/utils/netbox/build-etc-hosts-drake.py
@@ -9,17 +9,14 @@
# Dependencies: PyYAML, pynetbox
# -------------------------------------------------------------
-
import logging
import os
import pynetbox
import yaml
-
VRF_RD_DRAKE = "nasqueron.drake"
-
# -------------------------------------------------------------
# Get NetBox config and credentials
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/netbox/document-hypervisors.py b/utils/netbox/document-hypervisors.py
--- a/utils/netbox/document-hypervisors.py
+++ b/utils/netbox/document-hypervisors.py
@@ -11,7 +11,6 @@
# Dependencies: PyYAML, pynetbox
# -------------------------------------------------------------
-
import logging
import os
import sys
@@ -20,10 +19,8 @@
import subprocess
import yaml
-
TAG_VMWARE = "VMWare ESXi"
-
# -------------------------------------------------------------
# Get NetBox config and credentials
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/next-uid.py b/utils/next-uid.py
--- a/utils/next-uid.py
+++ b/utils/next-uid.py
@@ -9,7 +9,6 @@
import yaml
-
USERS_DATASOURCE = "pillar/core/users.sls"
USERS_DATASOURCE_KEY = "shellusers"
USERS_CUT = 5000
diff --git a/utils/nginx/ranges2geo.py b/utils/nginx/ranges2geo.py
--- a/utils/nginx/ranges2geo.py
+++ b/utils/nginx/ranges2geo.py
@@ -7,10 +7,8 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import sys
-
# -------------------------------------------------------------
# Formatter for ngx_http_geo_module
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/show-local-states.py b/utils/show-local-states.py
--- a/utils/show-local-states.py
+++ b/utils/show-local-states.py
@@ -9,11 +9,9 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-
import json
import subprocess
-
# -------------------------------------------------------------
# Show state information
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/templates/create.py b/utils/templates/create.py
--- a/utils/templates/create.py
+++ b/utils/templates/create.py
@@ -8,17 +8,14 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import os
import subprocess
import sys
import yaml
-
ROOT_TEMPLATE_DIR = "_resources/templates"
-
# -------------------------------------------------------------
# Configuration and directories helpers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/utils/vault/issue-admin-token.py b/utils/vault/issue-admin-token.py
--- a/utils/vault/issue-admin-token.py
+++ b/utils/vault/issue-admin-token.py
@@ -8,12 +8,10 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import hvac
import yaml
import sys
-
VAULT_TLS_CERTIFICATE_PATH = "/usr/local/share/certs/nasqueron-root-ca.crt"
diff --git a/utils/vault/wordpress-provision-secrets.py b/utils/vault/wordpress-provision-secrets.py
--- a/utils/vault/wordpress-provision-secrets.py
+++ b/utils/vault/wordpress-provision-secrets.py
@@ -10,7 +10,6 @@
# License: BSD-2-Clause
# -------------------------------------------------------------
-
import os
import secrets
import string
@@ -18,7 +17,6 @@
import hvac
-
# -------------------------------------------------------------
# WordPress secrets
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 25, 19:09 (6 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3562230
Default Alt Text
D4028.id10525.diff (19 KB)
Attached To
Mode
D4028: Update Black style
Attached
Detach File
Event Timeline
Log In to Comment