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

Misc fixes #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/saltfactories/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def _terminate(self):
log.info("Stopping %s", self.factory)
pid = self.pid
# Collect any child processes information before terminating the process
with contextlib.suppress(psutil.NoSuchProcess):
with contextlib.suppress(psutil.NoSuchProcess, psutil.AccessDenied):
for child in psutil.Process(pid).children(recursive=True):
if child not in self._children: # pylint: disable=access-member-before-definition
self._children.append(child) # pylint: disable=access-member-before-definition
Expand Down
13 changes: 0 additions & 13 deletions src/saltfactories/daemons/sshd.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ def _write_config(self):
config_lines.append(f"{key} {value}\n")

# Let's generate the host keys
if platform.is_fips_enabled() is False:
self._generate_server_dsa_key()
self._generate_server_ecdsa_key()
self._generate_server_ed25519_key()
for host_key in pathlib.Path(self.config_dir).glob("ssh_host_*_key"):
Expand All @@ -184,17 +182,6 @@ def _generate_client_ecdsa_key(self):
key_path.chmod(0o0400)
return key_path_prv

def _generate_server_dsa_key(self):
key_filename = "ssh_host_dsa_key"
key_path_prv = self.config_dir / key_filename
key_path_pub = self.config_dir / f"{key_filename}.pub"
if key_path_prv.exists() and key_path_pub.exists():
return key_path_prv
self._ssh_keygen(key_filename, "dsa", "1024")
for key_path in (key_path_prv, key_path_pub):
key_path.chmod(0o0400)
return key_path_prv

def _generate_server_ecdsa_key(self):
key_filename = "ssh_host_ecdsa_key"
key_path_prv = self.config_dir / key_filename
Expand Down
Loading