summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-04-17 15:40:02 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-04-17 15:50:35 +0200
commit7ccc4980147954b68829d5555fcc9e5b7dd2c4ec (patch)
tree1cf06afe9ba92ab85386002f44f6fb1f971ab584 /main.py
parentdfb69e9dd5f983bc2f97302866fcf37f2ef5d064 (diff)
Use samba for create and restore virtual partitions
This requires to configure user and password for samba repositories.
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.py b/main.py
index a67362d..e6cacf5 100755
--- a/main.py
+++ b/main.py
@@ -25,8 +25,17 @@ def main():
port = ogconfig.get_value_section('opengnsys', 'port')
url = ogconfig.get_value_section('opengnsys', 'url')
mode = ogconfig.get_value_section('opengnsys', 'mode')
+ samba_user = ogconfig.get_value_section('samba', 'user')
+ samba_pass = ogconfig.get_value_section('samba', 'pass')
- client = ogClient(ip, int(port), mode)
+ samba_config = None
+
+ if mode == 'linux':
+ proc = subprocess.Popen(["browser", "-qws", url])
+ elif mode == 'virtual':
+ samba_config = {'user': samba_user, 'pass': samba_pass}
+
+ client = ogClient(ip, int(port), mode, samba_config)
client.connect()
client.run()