Commit 9899caa0 authored by Rene Hadler's avatar Rene Hadler

Move locales generation, test cifs password 3 times

parent a198211f
......@@ -14,7 +14,7 @@ import subprocess
import requests
# Globale Variablen
VERSION = "0.9.3"
VERSION = "0.9.4"
TITLE = "iteas Proxmox Installer " + VERSION
CHECK_INTERNET_IP = "77.235.68.39"
VM_TEMPLATE_CIFS_SHARE = "//srv-backup01.iteas.at/archiv-replica"
......@@ -488,10 +488,6 @@ class Installer():
self.step1()
def step2(self):
# Set locales
file_replace_line("/etc/locale.gen", "# de_AT.UTF-8 UTF-8", "de_AT.UTF-8 UTF-8")
file_replace_line("/etc/locale.gen", "# de_DE.UTF-8 UTF-8", "de_DE.UTF-8 UTF-8")
run_cmd('locale-gen', argShell=True)
if self.environment == "stable" and self.license == "":
gui_message_box("Installer", "Sie muessen eine Lizenz angeben wenn Enterprise Updates ausgewaehlt wurden!")
......@@ -503,6 +499,11 @@ class Installer():
self.step1()
return
# Set locales
file_replace_line("/etc/locale.gen", "# de_AT.UTF-8 UTF-8", "de_AT.UTF-8 UTF-8")
file_replace_line("/etc/locale.gen", "# de_DE.UTF-8 UTF-8", "de_DE.UTF-8 UTF-8")
run_cmd('locale-gen', argShell=True)
############ Allgemeine Konfiguration
if self.license != "":
retval = run_cmd_output('pvesubscription set ' + self.license)
......@@ -560,7 +561,18 @@ class Installer():
if len(self.vm_import) > 0:
retval = gui_password_box("Samba Passwort benötigt", "Bitte das Passwort für Share " + VM_TEMPLATE_CIFS_SHARE + " und Benutzer " + VM_TEMPLATE_CIFS_USER + " eingeben.")
VM_TEMPLATE_CIFS_PASS = retval[1]
if run_cmd('mount -t cifs -o user=' + VM_TEMPLATE_CIFS_USER + ",password=" + VM_TEMPLATE_CIFS_PASS + " " + VM_TEMPLATE_CIFS_SHARE + ' /mnt') == 0:
cifscnt = 1
cifstest = run_cmd('mount -t cifs -o user=' + VM_TEMPLATE_CIFS_USER + ",password=" + VM_TEMPLATE_CIFS_PASS + " " + VM_TEMPLATE_CIFS_SHARE + ' /mnt')
while cifstest != 0 and cifscnt < 3:
retval = gui_password_box("Passwort falsch, Samba Passwort benötigt", "Bitte das Passwort für Share " + VM_TEMPLATE_CIFS_SHARE + " und Benutzer " + VM_TEMPLATE_CIFS_USER + " erneut eingeben.")
VM_TEMPLATE_CIFS_PASS = retval[1]
cifstest = run_cmd('mount -t cifs -o user=' + VM_TEMPLATE_CIFS_USER + ",password=" + VM_TEMPLATE_CIFS_PASS + " " + VM_TEMPLATE_CIFS_SHARE + ' /mnt')
if cifstest == 0:
break
cifscnt += 1
if cifstest == 0:
for vm_id in self.vm_import:
(ret, filename) = run_cmd_stdout("ls -t /mnt/dump/vzdump-qemu-%s*vma* | head -n1" % vm_id, argShell=True)
if filename != "":
......@@ -570,7 +582,7 @@ class Installer():
run_cmd('umount /mnt')
else:
gui_message_box("Installer", "CIFS konnte nicht gemounted werden, VMs werden nicht importiert!")
gui_message_box("Installer", "CIFS konnte nicht gemounted werden (Passwort falsch?), VMs werden nicht importiert!")
VM_TEMPLATE_CIFS_PASS = ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment