Fixes to get example running. Start adding test.
This commit is contained in:
parent
4843413883
commit
bda8084172
9 changed files with 47 additions and 16 deletions
|
@ -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)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue