- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
26 lines
775 B
Python
26 lines
775 B
Python
__author__ = "Markus Reiter"
|
|
__copyright__ = "(c) Markus Reiter 2022"
|
|
__license__ = "MIT"
|
|
|
|
import shutil
|
|
from subprocess import PIPE, Popen
|
|
|
|
from proxmoxer.backends.command_base import CommandBaseBackend, CommandBaseSession
|
|
|
|
|
|
class LocalSession(CommandBaseSession):
|
|
def _exec(self, cmd):
|
|
proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
|
stdout, stderr = proc.communicate(timeout=self.timeout)
|
|
return stdout.decode(), stderr.decode()
|
|
|
|
def upload_file_obj(self, file_obj, remote_path):
|
|
with open(remote_path, "wb") as dest_fp:
|
|
shutil.copyfileobj(file_obj, dest_fp)
|
|
|
|
|
|
class Backend(CommandBaseBackend):
|
|
def __init__(self, *args, **kwargs):
|
|
self.session = LocalSession(*args, **kwargs)
|
|
self.target = "localhost"
|