Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some unnecessary imports #11175

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build-scripts/build_templated_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import print_function

import os
import argparse

import ssg.environment
Expand Down
1 change: 0 additions & 1 deletion build-scripts/compile_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import argparse
import os.path
from glob import glob

import ssg.build_profile
import ssg.build_yaml
Expand Down
1 change: 0 additions & 1 deletion build-scripts/generate_man_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import print_function

import argparse
import sys
import ssg.build_profile
import ssg.constants
# ssg.xml provides ElementTree which is a wrapper for standard ElementTree
Expand Down
1 change: 0 additions & 1 deletion build-scripts/profile_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import jinja2
import os
import os.path
import sys

try:
import ssg.build_profile
Expand Down
2 changes: 0 additions & 2 deletions shared/templates/accounts_password/template.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from ssg.utils import parse_template_boolean_value

def preprocess(data, lang):
data["zero_comparison_operation"] = data.get("zero_comparison_operation", None)

Expand Down
3 changes: 0 additions & 3 deletions shared/templates/audit_rules_file_deletion_events/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import ssg.utils


def _audit_rules_file_deletion_events(data, lang):
if lang == "bash":
if "syscall_grouping" in data:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import ssg.utils


def _audit_rules_unsuccessful_file_modification(data, lang):
if lang == "bash":
if "syscall_grouping" in data:
Expand Down
3 changes: 0 additions & 3 deletions shared/templates/compliance_operator_not_found/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from ssg.utils import parse_template_boolean_value


def preprocess(data, lang):

return data
1 change: 0 additions & 1 deletion ssg/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from .constants import ansible_version_requirement_pre_task_name
from .constants import min_ansible_version
from .constants import REF_PREFIX_MAP


def add_minimum_version(ansible_src):
Expand Down
3 changes: 1 addition & 2 deletions ssg/build_ovals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import os.path
import sys
import re
from copy import deepcopy
import collections

Expand All @@ -16,7 +15,7 @@
from .id_translate import IDTranslator
from .jinja import process_file_with_macros
from .rule_yaml import parse_prodtype
from .rules import get_rule_dir_id, get_rule_dir_ovals, find_rule_dirs_in_paths
from .rules import get_rule_dir_ovals, find_rule_dirs_in_paths
from . import utils, products
from .utils import mkdir_p
from .xml import ElementTree, oval_generated_header
Expand Down
1 change: 0 additions & 1 deletion ssg/build_sce.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import os.path
import json
import sys

from .build_yaml import Rule, DocumentationNotComplete
from .constants import (
Expand Down
1 change: 0 additions & 1 deletion ssg/build_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import print_function

from copy import deepcopy
import collections
import datetime
import json
import os
Expand Down
1 change: 0 additions & 1 deletion ssg/fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import print_function

import os
import re

from .build_remediations import parse_from_file_without_jinja
from .rule_yaml import parse_prodtype
Expand Down
1 change: 0 additions & 1 deletion ssg/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import print_function

import os
from glob import glob


def get_rule_dir_yaml(dir_path):
Expand Down
2 changes: 1 addition & 1 deletion ssg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .constants import (FULL_NAME_TO_PRODUCT_MAPPING,
MAKEFILE_ID_TO_PRODUCT_MAP,
MULTI_PLATFORM_LIST,
MULTI_PLATFORM_MAPPING)
)


class SSGError(RuntimeError):
Expand Down
1 change: 0 additions & 1 deletion ssg/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import platform
import re
import xml.etree.ElementTree as ET

from .constants import (
xml_version, oval_header, timestamp, PREFIX_TO_NS, XCCDF11_NS, XCCDF12_NS)
Expand Down
1 change: 0 additions & 1 deletion utils/autoprodtyper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/python3

import sys
import os
import argparse
import json
Expand Down
1 change: 0 additions & 1 deletion utils/controlrefcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import sys

try:
from ssg.build_cpe import ProductCPEs
import ssg.build_profile
import ssg.controls
import ssg.environment
Expand Down
1 change: 0 additions & 1 deletion utils/create_scap_delta_tailoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import ssg.constants
import ssg.rules
import ssg.yaml
import ssg.build_yaml
import ssg.environment

SSG_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
Expand Down
1 change: 0 additions & 1 deletion utils/fix_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import argparse
import json
import re
import random

from ssg import yaml, cce, products
from ssg.shims import input_func
Expand Down
4 changes: 0 additions & 4 deletions utils/gen_multiple_reference_tables.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/usr/bin/python3

import os
import re
import glob
import argparse

import ssg.build_yaml
import ssg.constants

from utils import gen_reference_table
Expand Down
2 changes: 0 additions & 2 deletions utils/gen_profile_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import os
import sys

import argparse

import ssg.build_yaml

import tables.table_renderer
Expand Down
1 change: 0 additions & 1 deletion utils/gen_srg_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import argparse
import collections
import os
import xml.etree.ElementTree as ET

import ssg.build_stig
import ssg.build_yaml
Expand Down
4 changes: 0 additions & 4 deletions utils/render-policy.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/usr/bin/python3

from glob import glob
import collections
import os
import pathlib

import argparse

import ssg.build_yaml
import ssg.controls
Expand Down
1 change: 0 additions & 1 deletion utils/render-rule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/python3

from glob import glob
import collections
import sys
import pathlib
Expand Down
5 changes: 0 additions & 5 deletions utils/render-rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
from __future__ import print_function

from glob import glob
import collections
import os
import re
import pathlib

import argparse

import ssg.build_yaml
import ssg.controls
Expand Down
1 change: 0 additions & 1 deletion utils/srg_export/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pathlib
import pandas as pd
import create_srg_export

import utils.srg_export.data

Expand Down
4 changes: 0 additions & 4 deletions utils/srg_export/md.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import re

import create_srg_export

import utils.srg_export.data


Expand Down
3 changes: 0 additions & 3 deletions utils/srg_export/xlsx.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env python3

import datetime
import os
import openpyxl
from openpyxl.styles import Alignment, Font, PatternFill
from openpyxl.styles.colors import Color
import create_srg_export

import utils.srg_export.data

Expand Down
3 changes: 0 additions & 3 deletions utils/tables/table_renderer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import collections
import os
import sys
import re

import argparse

import ssg.build_yaml
import ssg.constants

Expand Down
2 changes: 0 additions & 2 deletions utils/template_renderer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/python3

from glob import glob
import collections
import os

import argparse
Expand Down
Loading