diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-04-17 15:40:02 +0200 |
---|---|---|
committer | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-04-17 15:50:35 +0200 |
commit | 7ccc4980147954b68829d5555fcc9e5b7dd2c4ec (patch) | |
tree | 1cf06afe9ba92ab85386002f44f6fb1f971ab584 /src/ogClient.py | |
parent | dfb69e9dd5f983bc2f97302866fcf37f2ef5d064 (diff) |
Use samba for create and restore virtual partitions
This requires to configure user and password for samba repositories.
Diffstat (limited to 'src/ogClient.py')
-rw-r--r-- | src/ogClient.py | 9 |
1 files changed, 7 insertions, 2 deletions
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 |