Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
62 changes: 31 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,37 @@ select = [

# We may want to adhere to D205 and D415 in the future.
ignore = [
"D100", # Missing docstring in public module
"D105", # Missing docstring in magic method
"D104", # Missing docstring in public package
"D200", # One-line docstring should fit on one line with quotes
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D415", # First line should end with a period, question mark, or exclamation point
"S101", # Ignore assert statements
"S403", # Ignore warnings about importing pickle
"S301", # suspicious-pickle-usage
"S603", # subprocess-without-shell-equals-true
"S404", # Ignore warnings about importing subprocess
"S311", # Ignore warnings about using random
"S608", # Ignore warning about possible SQL injection. SQL is not used in FIREWHEEL.
"PLW2901", # redefined-loop-name
"RUF100", # unused-noqa
"RUF012", # mutable-class-default
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0914", # too-many-locals
"PLR0915", # too-many-statements
"PLR1702", # too-many-nested-blocks
"PLR0917", # too-many-positional-arguments
"PLR2004", # magic-value-comparison
"PLR6301", # no-self-use
"DOC502", # docstring-extraneous-exception -- Has lots of false positives currently
"PERF203", # try-except-in-loop
"PERF401", # manual-list-comprehension
"undocumented-public-module", # Missing docstring in public module
"undocumented-magic-method", # Missing docstring in magic method
"undocumented-public-package", # Missing docstring in public package
"unnecessary-multiline-docstring", # One-line docstring should fit on one line with quotes
"blank-line-after-function", # No blank lines allowed after function docstring
"missing-blank-line-after-summary", # 1 blank line required between summary line and description
"multi-line-summary-first-line", # Multi-line docstring summary should start at the first line
"missing-terminal-punctuation", # First line should end with a period, question mark, or exclamation point
"assert", # Ignore assert statements
"suspicious-pickle-import", # Ignore warnings about importing pickle
"suspicious-pickle-usage", # suspicious-pickle-usage
"subprocess-without-shell-equals-true", # subprocess-without-shell-equals-true
"suspicious-subprocess-import", # Ignore warnings about importing subprocess
"suspicious-non-cryptographic-random-usage", # Ignore warnings about using random
"hardcoded-sql-expression", # Ignore warning about possible SQL injection. SQL is not used in FIREWHEEL.
"redefined-loop-name", # redefined-loop-name
"unused-noqa", # unused-noqa
"mutable-class-default", # mutable-class-default
"too-many-public-methods", # too-many-public-methods
"too-many-return-statements", # too-many-return-statements
"too-many-branches", # too-many-branches
"too-many-arguments", # too-many-arguments
"too-many-locals", # too-many-locals
"too-many-statements", # too-many-statements
"too-many-nested-blocks", # too-many-nested-blocks
"too-many-positional-arguments", # too-many-positional-arguments
"magic-value-comparison", # magic-value-comparison
"no-self-use", # no-self-use
"docstring-extraneous-exception", # docstring-extraneous-exception -- Has lots of false positives currently
"try-except-in-loop", # try-except-in-loop
"manual-list-comprehension", # manual-list-comprehension
]
preview = true
# Allow fix for all enabled rules (when `--fix`) is provided.
Expand Down
34 changes: 24 additions & 10 deletions src/firewheel_repo_linux/linux/model_component_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,16 @@ def add_root_profiles(self):
)
self.run_executable(-246, "rm", "-f /root/combined_profiles.tgz")

def configure_ips(self, start_time=-200):
def _configure_ips(self):
"""
Configure the IP addresses of the VM

Args:
start_time (int): The start time to configure the VM's hostname (default=-200)
Create the format for configuring the IP addresses of Linux VMs

Returns:
bool: True if successful, False otherwise.
str: The completed configuration
"""
self.interfaces = getattr(self, "interfaces", None)
if not self.interfaces:
return False
return ""

try:
nameservers = self.dns_nameservers
Expand Down Expand Up @@ -162,9 +159,24 @@ def configure_ips(self, start_time=-200):
config += "\n"

if not config:
return
return ""

return f"{nameservers}\n{config}"

def configure_ips(self, start_time=-200):
"""
Configure the IP addresses of the VM

Args:
start_time (int): The start time to configure the VM's hostname (default=-200)

config = f"{nameservers}\n{config}"
Returns:
bool: True if successful, False otherwise.
"""
config = self._configure_ips()

if not config:
return False

self.add_vm_resource(start_time, "configure_ips.sh", config)

Expand Down Expand Up @@ -232,7 +244,9 @@ def unpack_tar(
exec_vm_resource.add_file(archive, archive)


def configure_ip_conflict_handler(entry_name, _decorator_value, _current_instance_value):
def configure_ip_conflict_handler(
entry_name, _decorator_value, _current_instance_value
):
"""
The conflict handler for functions overwritten in LinuxNetplanHost that are
also implemented in LinuxHost, i.e. the ``configure_ips`` function.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ passenv =

[testenv:ruff]
basepython = python3
deps = ruff==0.7.1
deps = ruff~=0.16.0
commands =
ruff check {posargs}

Expand Down
Loading