From 7ccc4980147954b68829d5555fcc9e5b7dd2c4ec Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Fri, 17 Apr 2020 15:40:02 +0200 Subject: Use samba for create and restore virtual partitions This requires to configure user and password for samba repositories. --- src/ogClient.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ogClient.py') diff --git a/src/ogClient.py b/src/ogClient.py index b9f6a95..ff2c704 100644 --- a/src/ogClient.py +++ b/src/ogClient.py @@ -23,14 +23,19 @@ class State(Enum): FORCE_DISCONNECTED = 2 class ogClient: - def __init__(self, ip, port, mode): + def __init__(self, ip, port, mode, samba_config=None): if mode not in {'virtual', 'linux'}: raise ValueError('Mode not supported.') + if samba_config: + assert('user' in samba_config) + assert('pass' in samba_config) + self.ip = ip self.port = port self.mode = mode - self.ogrest = ogRest(self.mode) + self.samba_config = samba_config + self.ogrest = ogRest(self.mode, self.samba_config) def get_socket(self): return self.sock -- cgit v1.2.3-18-g5258