8000 Autoinstall Manager: Fix utils.die calls and removed unused variable by SchoolGuy · Pull Request #2791 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Autoinstall Manager: Fix utils.die calls and removed unused variable #2791

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

Merged
merged 1 commit into from
Sep 17, 2021
Merged
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
8 changes: 3 additions & 5 deletions cobbler/autoinstall_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ def write_autoinstall_template(self, file_path: str, data: str) -> bool:
try:
utils.mkdir(os.path.dirname(file_full_path))
except:
utils.die(self.logger, "unable to create directory for automatic OS installation template at %s"
% file_path)
utils.die("unable to create directory for automatic OS installation template at %s" % file_path)

fileh = open(file_full_path, "w+")
fileh.write(data)
Expand All @@ -142,7 +141,7 @@ def remove_autoinstall_template(self, file_path: str):
if not self.is_autoinstall_in_use(file_path):
os.remove(file_full_path)
else:
utils.die(self.logger, "attempt to delete in-use file")
utils.die("attempt to delete in-use file")

def validate_autoinstall_snippet_file_path(self, snippet: str, new_snippet: bool = False) -> str:
"""
Expand Down Expand Up @@ -219,7 +218,7 @@ def write_autoinstall_snippet(self, file_path: str, data: str):
try:
utils.mkdir(os.path.dirname(file_full_path))
except:
utils.die(self.logger, "unable to create directory for automatic OS installation snippet at %s" % file_path)
utils.die("unable to create directory for automatic OS installation snippet at %s" % file_path)

fileh = open(file_full_path, "w+")
fileh.write(data)
Expand Down Expand Up @@ -294,7 +293,6 @@ def validate_autoinstall_file(self, obj, is_profile: bool) -> list:
:returns: [bool, int, list] list with validation result, errors type and list of errors
"""

last_errors = []
blended = utils.blender(self.collection_mgr.api, False, obj)

# get automatic installation template
Expand Down
0