Fixes to get example running. Start adding test.

This commit is contained in:
James Grogan 2024-03-29 12:39:44 +00:00
parent 4843413883
commit bda8084172
9 changed files with 47 additions and 16 deletions

View file

@ -3,6 +3,8 @@ import logging
from .util import run_op
logger = logging.getLogger(__name__)
class SshConfig:
def __init__(self):
@ -13,14 +15,16 @@ class SshConfig:
"UsePAM": "No"}
def sync_target_values(self):
logging.info(f"Updating ssh config in: {self.config_path}")
logger.info(f"Updating ssh config in: {self.config_path}")
pass
def restart_service(self):
op = "systemctl restart ssh"
logging.info(f"Restarting ssh service: {op}")
logger.info(f"Restarting ssh service: {op}")
run_op(op)
def copy_ssh_dir_to_user(self, username:str):
op = f"rsync --archive --chown={username}:{username} ~/.ssh /home/{username}"
logger.info(f"Copying ssh dir to user: {op}")
run_op(op)