diff --git a/instances/forms.py b/instances/forms.py index 1e5cf269..37310a56 100644 --- a/instances/forms.py +++ b/instances/forms.py @@ -87,9 +87,9 @@ class ConsoleForm(forms.Form): password = data.get("password", "") if not password: self.add_error("password", _("Enter the new password.")) - # VNC uses 8 bytes; libvirt refuses a longer password - elif len(password.encode()) > 8: - self.add_error("password", _("A VNC password takes at most 8 bytes.")) + # VNC takes 8 bytes, and the browser console sends only ASCII as typed + elif len(password) > 8 or not all(" " <= c <= "~" for c in password): + self.add_error("password", _("A VNC password takes up to 8 letters, digits or symbols, without accents.")) # A console that listens beyond localhost (set by an administrator) # keeps its password unless an administrator removes it. if action == "none" and not self.is_superuser and not self.instance.proxy.console_listens_locally(): diff --git a/instances/templates/instances/settings_tab.html b/instances/templates/instances/settings_tab.html index cda5d9d5..bf9bab56 100644 --- a/instances/templates/instances/settings_tab.html +++ b/instances/templates/instances/settings_tab.html @@ -745,7 +745,7 @@
{{ console_form.password }} -

{% trans "Up to 8 characters; an accented letter counts as two." %}

+

{% trans "Up to 8 letters, digits or symbols, without accents." %}

{% endif %} {% endfor %} diff --git a/instances/tests/test_console_access.py b/instances/tests/test_console_access.py index 1ecf1b49..1c7d3edc 100644 --- a/instances/tests/test_console_access.py +++ b/instances/tests/test_console_access.py @@ -71,9 +71,10 @@ class CanOpenConsoleTestCase(TestCase): self.owner.user_permissions.add(Permission.objects.get(codename="passwordless_console")) with patch("instances.models.wvmInstance") as wvm: proxy = wvm.return_value.cached_reads.return_value.__enter__.return_value - proxy.get_console_passwd.return_value = "secret" + proxy.get_console_passwd.return_value = " a\\nb" res = self.client.get(reverse("instances:getvvfile", args=[self.instance.id])) - self.assertIn(b"password=secret\n", res.content) + # as a key file reads it back: the leading space and the backslash stay + self.assertIn(b"password=\\sa\\\\nb\n", res.content) def test_owner_can_get_vdi_url(self): self.client.force_login(self.owner) diff --git a/instances/tests/test_console_settings.py b/instances/tests/test_console_settings.py index 5f10f87a..8835d783 100644 --- a/instances/tests/test_console_settings.py +++ b/instances/tests/test_console_settings.py @@ -53,7 +53,7 @@ class UpdateConsoleTestCase(TestCase): proxy.set_console_keymap.assert_not_called() def test_the_password_changes_by_the_action_chosen(self): - for action, password in (("set", " a b c "), ("set", "éééé"), ("none", "")): + for action, password in (("set", " a b c "), ("set", "~a\\b{}!"), ("none", "")): with self.subTest(action, password=password): proxy, _ = self.post({**VNC, "password_action": action, "password": password}) proxy.set_console_passwd.assert_called_once_with(password) @@ -62,7 +62,8 @@ class UpdateConsoleTestCase(TestCase): self.assertEqual(len(generated), 8) def test_a_password_vnc_cannot_take_is_refused_and_nothing_is_saved(self): - for password in ("", "123456789", "ééééé"): # libvirt counts bytes: é is two + # the browser console sends the password's characters, QEMU expects its bytes + for password in ("", "123456789", "éé", "a\nb", "a\tb"): with self.subTest(password=password): proxy, messages = self.post({**VNC, "keymap": "de", "password_action": "set", "password": password}) proxy.set_console_passwd.assert_not_called() diff --git a/instances/views.py b/instances/views.py index 3e08df23..b60407b2 100755 --- a/instances/views.py +++ b/instances/views.py @@ -2461,6 +2461,13 @@ def set_template(request, pk): return _back(request, pk, "options") +def keyfile_value(value): + """value as a GLib key file (the .vv file) reads it back: a backslash, + a line break or a leading space would change it.""" + value = value.replace("\\", "\\\\").replace("\n", "\\n").replace("\r", "\\r").replace("\t", "\\t") + return "\\s" + value[1:] if value.startswith(" ") else value + + def getvvfile(request, pk): instance = get_instance(request.user, pk) # The .vv file contains the VNC password: same rule as the console. @@ -2480,10 +2487,10 @@ def getvvfile(request, pk): response.writelines(f"type={proxy.get_console_type()}\n") response.writelines(f"host={proxy.host if listen == '0.0.0.0' else listen}\n") response.writelines(f"port={proxy.get_console_port()}\n") - response.writelines(f"title={proxy.instance.name()}\n") + response.writelines(f"title={keyfile_value(proxy.instance.name())}\n") # as the console page: without the permission the viewer asks for the password if request.user.has_perm("instances.passwordless_console"): - response.writelines(f"password={proxy.get_console_passwd() or ''}\n") + response.writelines(f"password={keyfile_value(proxy.get_console_passwd() or '')}\n") response.writelines("enable-usbredir=1\n") response.writelines("disable-effects=all\n") response.writelines("secure-attention=ctrl+alt+ins\n") diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index e879e527..c5bf9367 100644 Binary files a/locale/tr/LC_MESSAGES/django.mo and b/locale/tr/LC_MESSAGES/django.mo differ diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po index 4ad5ec8f..8b74973b 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-13 13:07+0000\n" +"POT-Creation-Date: 2026-11-13 19:25+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n" "Last-Translator: catborise , 2020\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n" @@ -1976,12 +1976,12 @@ msgstr "" "sanal makinenin root parolasını ve SSH anahtarını bununla ayarlar; boş: bu " "sunucuda ayarlanamazlar" -#: computes/models.py:179 +#: computes/models.py:180 #, python-format msgid "This host is already added as %(name)s" msgstr "Bu sunucu zaten %(name)s olarak ekli" -#: computes/models.py:182 +#: computes/models.py:183 #, python-format msgid "" "The panel cannot reach the host to tell that its VMs are there: %(error)s" @@ -1989,7 +1989,7 @@ msgstr "" "Panel sunucuya ulaşamadığı için VM'lerinin orada olduğunu doğrulayamıyor: " "%(error)s" -#: computes/models.py:189 +#: computes/models.py:190 msgid "" "The host its VMs are on is not known yet: change the connection when the " "panel has reached the host at its current one" @@ -1997,7 +1997,7 @@ msgstr "" "VM'lerinin bulunduğu sunucu henüz bilinmiyor: bağlantıyı, panel sunucuya " "mevcut bağlantısından ulaştıktan sonra değiştirin" -#: computes/models.py:192 +#: computes/models.py:193 msgid "This is another host than the one its VMs are on: add it as a new host" msgstr "" "Bu, VM'lerinin bulunduğu sunucudan başka bir sunucu: yeni bir sunucu olarak " @@ -2506,17 +2506,17 @@ msgstr "" "Sunucudaki /etc/default/webvirt-gstfsd içindeki GSTFSD_KEY değerinin 64 " "onaltılık karakterini girin" -#: computes/views.py:122 +#: computes/views.py:148 #, python-format msgid "The host did not answer within %(seconds)s seconds" msgstr "Sunucu %(seconds)s saniye içinde yanıt vermedi" -#: computes/views.py:210 +#: computes/views.py:236 #, python-format msgid "The host was saved, but the panel cannot connect to it: %(error)s" msgstr "Sunucu kaydedildi, ancak panel ona bağlanamıyor: %(error)s" -#: computes/views.py:266 +#: computes/views.py:292 #, python-format msgid "" "Its VMs keep running on the host and leave the panel; their owners are kept " @@ -2851,8 +2851,10 @@ msgid "Enter the new password." msgstr "Yeni parolayı girin." #: instances/forms.py:92 -msgid "A VNC password takes at most 8 bytes." -msgstr "VNC parolası en fazla 8 bayt olabilir." +msgid "" +"A VNC password takes up to 8 letters, digits or symbols, without accents." +msgstr "" +"VNC parolası en çok 8 harf, rakam ya da simge alır; aksanlı harf olmaz." #: instances/forms.py:98 msgid "" @@ -2940,7 +2942,7 @@ msgstr "" msgid "Delete snapshot" msgstr "Anlık görüntüyü sil" -#: instances/jobs.py:356 vrtManager/instance.py:2388 +#: instances/jobs.py:356 vrtManager/instance.py:2389 #, python-format msgid "The VM has no external snapshot named %(name)s" msgstr "Sanal makinede %(name)s adında harici anlık görüntü yok" @@ -2975,7 +2977,7 @@ msgstr "Sanal makine artık işin çalıştığı sunucuda değil" msgid "Take snapshot" msgstr "Anlık görüntü al" -#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:1979 +#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:1980 #, python-format msgid "A snapshot named %(name)s already exists" msgstr "%(name)s adında bir anlık görüntü zaten var" @@ -3137,12 +3139,12 @@ msgstr "" msgid "Each network card needs a network" msgstr "Her ağ kartının bir ağı olmalı" -#: instances/jobs.py:851 vrtManager/instance.py:2846 +#: instances/jobs.py:851 vrtManager/instance.py:2847 #, python-format msgid "This host has no network %(name)s" msgstr "Bu sunucuda %(name)s ağı yok" -#: instances/jobs.py:853 vrtManager/instance.py:2848 +#: instances/jobs.py:853 vrtManager/instance.py:2849 #, python-format msgid "This host has no network filter %(name)s" msgstr "Bu sunucuda %(name)s ağ filtresi yok" @@ -3167,7 +3169,7 @@ msgstr "" msgid "Create VM" msgstr "Sanal makine oluştur" -#: instances/jobs.py:910 instances/jobs.py:956 instances/views.py:2539 +#: instances/jobs.py:910 instances/jobs.py:956 instances/views.py:2546 msgid "A virtual machine with this name already exists" msgstr "Bu isimde bir sanal makine mevcut" @@ -3216,7 +3218,7 @@ msgstr "cloud-init tohumu, disk için bir dizin depolama havuzu gerektirir" msgid "This host offers no firmware %(firmware)s" msgstr "Bu sunucu %(firmware)s firmware'ini sunmuyor" -#: instances/jobs.py:939 vrtManager/instance.py:3195 +#: instances/jobs.py:939 vrtManager/instance.py:3196 msgid "This host offers no TPM 2.0: install swtpm on it" msgstr "Bu sunucu TPM 2.0 sunmuyor: üzerine swtpm kurun" @@ -3527,7 +3529,7 @@ msgid "Disk source" msgstr "Disk kaynağı" #: instances/templates/add_instance_volume.html:21 -#: instances/templates/create_instance_w2.html:134 instances/views.py:2559 +#: instances/templates/create_instance_w2.html:134 instances/views.py:2566 msgid "New disk" msgstr "Yeni disk" @@ -3913,7 +3915,7 @@ msgstr "Özel CPU modelleri" msgid "Size (GiB)" msgstr "Boyut (GiB)" -#: instances/templates/create_instance_w2.html:161 instances/views.py:2560 +#: instances/templates/create_instance_w2.html:161 instances/views.py:2567 msgid "Existing volumes" msgstr "Mevcut birimler" @@ -3949,7 +3951,7 @@ msgstr "Aygıt" msgid "Remove" msgstr "Kaldır" -#: instances/templates/create_instance_w2.html:194 instances/views.py:2561 +#: instances/templates/create_instance_w2.html:194 instances/views.py:2568 msgid "Clone from template" msgstr "Şablondan klonla" @@ -4505,7 +4507,7 @@ msgid "Add USB device" msgstr "USB aygıtı ekle" #: instances/templates/instances/host_devices_form.html:18 -#: vrtManager/instance.py:3099 +#: vrtManager/instance.py:3100 msgid "" "A VM with a saved state does not change its USB devices: start it, or start " "it without its saved state" @@ -5634,8 +5636,8 @@ msgid "No password is set." msgstr "Parola ayarlanmamış." #: instances/templates/instances/settings_tab.html:748 -msgid "Up to 8 characters; an accented letter counts as two." -msgstr "En fazla 8 karakter; aksanlı bir harf iki sayılır." +msgid "Up to 8 letters, digits or symbols, without accents." +msgstr "En çok 8 harf, rakam ya da simge; aksanlı harf olmadan." #: instances/templates/instances/settings_tab.html:759 msgid "Save console settings" @@ -6528,7 +6530,7 @@ msgstr "Birim başarıyla değiştirildi." msgid "Disk %(dev)s is not a storage volume of this instance" msgstr "%(dev)s diski bu sanal makinenin bir depolama birimi değil" -#: instances/views.py:1554 vrtManager/instance.py:2398 +#: instances/views.py:1554 vrtManager/instance.py:2399 msgid "The VM has a saved state; start it or remove the saved state first" msgstr "" "Sanal makinenin kaydedilmiş durumu var; önce başlatın veya kaydedilmiş durumu" @@ -6606,7 +6608,7 @@ msgstr "Ön yükleme sırası başarıyla değiştirildi." msgid "The XML is empty" msgstr "XML boş" -#: instances/views.py:1903 instances/views.py:2550 +#: instances/views.py:1903 instances/views.py:2557 #, python-format msgid "The XML is not well-formed: %(error)s" msgstr "XML düzgün biçimlendirilmemiş: %(error)s" @@ -6762,28 +6764,28 @@ msgstr "Şablon olup olmadığını değiştirmek için sanal makineyi kapatın. msgid "%(quota)s: '%(instance_name)s' stays a template." msgstr "%(quota)s: '%(instance_name)s' şablon olarak kalıyor." -#: instances/views.py:2537 +#: instances/views.py:2544 msgid "The XML has no name" msgstr "XML'de ad yok" -#: instances/views.py:2552 webvirtcloud/middleware.py:156 +#: instances/views.py:2559 webvirtcloud/middleware.py:156 #, python-format msgid "libvirt Error - %(exception)s" msgstr "libvirt Hatası - %(exception)s" -#: instances/views.py:2559 +#: instances/views.py:2566 msgid "An empty disk of the size you set" msgstr "Belirlediğiniz boyutta boş bir disk" -#: instances/views.py:2560 +#: instances/views.py:2567 msgid "Volumes already in a pool" msgstr "Bir havuzda zaten bulunan birimler" -#: instances/views.py:2561 +#: instances/views.py:2568 msgid "A copy of a template volume" msgstr "Bir şablon biriminin kopyası" -#: instances/views.py:2639 +#: instances/views.py:2646 msgid "" "This host has no running storage pool for the VM's disks: add or start one on" " its Storage page." @@ -6791,29 +6793,29 @@ msgstr "" "Bu sunucuda sanal makinenin diskleri için çalışan bir depolama havuzu yok: " "Depolama sayfasından bir tane ekleyin ya da başlatın." -#: instances/views.py:2641 +#: instances/views.py:2648 msgid "This host has no network for the VM: add one on its Networks page." msgstr "" "Bu sunucuda sanal makine için ağ yok: Ağlar sayfasından bir tane ekleyin." -#: instances/views.py:2673 +#: instances/views.py:2680 #, python-format msgid "The machine type is q35, not %(machine)s: UEFI Secure Boot needs it" msgstr "Makine türü %(machine)s değil q35: UEFI Secure Boot bunu gerektiriyor" -#: instances/views.py:2700 +#: instances/views.py:2707 msgid "Flavor Created" msgstr "Flavor Oluşturuldu" -#: instances/views.py:2708 +#: instances/views.py:2715 msgid "Create Flavor" msgstr "Kullanıcı Oluştur" -#: instances/views.py:2720 +#: instances/views.py:2727 msgid "Flavor Deleted" msgstr "Flavor Silindi" -#: instances/views.py:2726 +#: instances/views.py:2733 msgid "Only the size template goes; VMs made from it keep their size." msgstr "" "Yalnızca boyut şablonu silinir; ondan oluşturulan sanal makineler boyutlarını" @@ -9611,11 +9613,11 @@ msgid "Please shutdown the instance then try to enable vCPU hotplug" msgstr "" "vCPU hotplug özelliğini etkinleştirmek için önce sanal makineyi kapatın" -#: vrtManager/instance.py:1761 +#: vrtManager/instance.py:1762 msgid "The VM has no video card" msgstr "Sanal makinede ekran kartı yok" -#: vrtManager/instance.py:1771 +#: vrtManager/instance.py:1772 #, python-format msgid "" "The VM's CPU topology has %(count)s vCPUs: change it in the XML editor to set" @@ -9624,62 +9626,62 @@ msgstr "" "VM'nin CPU topolojisi %(count)s vCPU içeriyor: başka bir en fazla değer için " "onu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:1797 +#: vrtManager/instance.py:1798 #, python-format msgid "The VM's next start has a maximum memory of %(max)s MiB" msgstr "" "Sanal makinenin bir sonraki başlangıcındaki en yüksek bellek %(max)s MiB" -#: vrtManager/instance.py:1938 +#: vrtManager/instance.py:1939 msgid "" "The VM has external snapshots; internal snapshots cannot be mixed with them" msgstr "" "Sanal makinenin harici anlık görüntüleri var; dahili anlık görüntüler " "bunlarla karıştırılamaz" -#: vrtManager/instance.py:1970 +#: vrtManager/instance.py:1971 msgid "A snapshot with memory is not quiesced; it keeps the whole guest state" msgstr "" "Bellekli bir anlık görüntüde dosya sistemleri dondurulmaz; tüm konuk durumunu" " saklar" -#: vrtManager/instance.py:1972 +#: vrtManager/instance.py:1973 msgid "Only a running VM's file systems can be frozen" msgstr "Yalnızca çalışan bir sanal makinenin dosya sistemleri dondurulabilir" -#: vrtManager/instance.py:1974 +#: vrtManager/instance.py:1975 msgid "The QEMU guest agent is not connected; it freezes the file systems" msgstr "QEMU konuk aracısı bağlı değil; dosya sistemlerini o dondurur" -#: vrtManager/instance.py:1977 +#: vrtManager/instance.py:1978 msgid "" "The VM has internal snapshots; external snapshots cannot be mixed with them" msgstr "" "Sanal makinenin dahili anlık görüntüleri var; harici anlık görüntüler " "bunlarla karıştırılamaz" -#: vrtManager/instance.py:1982 +#: vrtManager/instance.py:1983 msgid "Newer snapshots exist after the last revert; delete them first" msgstr "" "Son geri dönüşten sonra daha yeni anlık görüntüler var; önce onları silin" -#: vrtManager/instance.py:1985 +#: vrtManager/instance.py:1986 msgid "No snapshot is current; revert to a snapshot first" msgstr "Geçerli anlık görüntü yok; önce bir anlık görüntüye geri dönün" -#: vrtManager/instance.py:1991 +#: vrtManager/instance.py:1992 #, python-format msgid "Eject the media from %(dev)s first" msgstr "Önce %(dev)s içindeki ortamı çıkarın" -#: vrtManager/instance.py:1993 +#: vrtManager/instance.py:1994 #, python-format msgid "Disk %(dev)s is not a file; external snapshots need file disks" msgstr "" "Disk %(dev)s bir dosya değil; harici anlık görüntüler dosya diskleri " "gerektirir" -#: vrtManager/instance.py:2001 +#: vrtManager/instance.py:2002 #, python-format msgid "" "The storage pools could not be refreshed, so their free space is unknown: " @@ -9687,21 +9689,21 @@ msgid "" msgstr "" "Depolama havuzları yenilenemedi, bu yüzden boş alanları bilinmiyor: %(err)s" -#: vrtManager/instance.py:2022 +#: vrtManager/instance.py:2023 msgid "Memory is saved only from a running VM" msgstr "Bellek yalnızca çalışan bir sanal makineden kaydedilir" -#: vrtManager/instance.py:2024 +#: vrtManager/instance.py:2025 msgid "The VM has no disk to keep its memory next to" msgstr "Sanal makinenin, belleğinin yanına kaydedileceği bir diski yok" -#: vrtManager/instance.py:2028 +#: vrtManager/instance.py:2029 #, python-format msgid "%(disk)s is not in a storage pool; memory is saved only into one" msgstr "" "%(disk)s bir depolama havuzunda değil; bellek yalnızca bir havuza kaydedilir" -#: vrtManager/instance.py:2059 +#: vrtManager/instance.py:2060 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the snapshot needs %(size).1f " @@ -9712,7 +9714,7 @@ msgstr "" "%(size).1f GiB gerektiriyor (sanal makinenin oradaki disklerinin " "%%%(percent)g kadarı, en az %(minimum)g GiB, ve kaydediliyorsa bellek)" -#: vrtManager/instance.py:2077 +#: vrtManager/instance.py:2078 msgid "" "This snapshot was taken by an older version on a UEFI VM and cannot be " "reverted; delete it instead" @@ -9720,7 +9722,7 @@ msgstr "" "Bu anlık görüntü UEFI bir sanal makinede eski bir sürümle alındı ve geri " "dönülemez; bunun yerine silin" -#: vrtManager/instance.py:2107 +#: vrtManager/instance.py:2108 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is " @@ -9729,7 +9731,7 @@ msgstr "" "Geri dönüş iki kez başarısız oldu; biraz sonra tekrar deneyin (%(error)s). " "Sanal makine çalışıyor." -#: vrtManager/instance.py:2109 +#: vrtManager/instance.py:2110 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is shut " @@ -9738,13 +9740,13 @@ msgstr "" "Geri dönüş iki kez başarısız oldu; biraz sonra tekrar deneyin (%(error)s). " "Sanal makine kapalı." -#: vrtManager/instance.py:2277 +#: vrtManager/instance.py:2278 msgid "A disk moves when its VM is defined and running, paused or shut off" msgstr "" "Bir disk, sanal makinesi tanımlıyken ve çalışırken, duraklatılmışken veya " "kapalıyken taşınır" -#: vrtManager/instance.py:2279 +#: vrtManager/instance.py:2280 msgid "" "A disk of a VM with snapshots, a saved state or a running block job does not " "move" @@ -9752,7 +9754,7 @@ msgstr "" "Anlık görüntüleri, kaydedilmiş durumu veya çalışan bir blok işi olan sanal " "makinenin diski taşınmaz" -#: vrtManager/instance.py:2287 +#: vrtManager/instance.py:2288 #, python-format msgid "" "%(dev)s is not a disk file of the VM, the same in its running and next " @@ -9761,127 +9763,127 @@ msgstr "" "%(dev)s, sanal makinenin çalışan ve sonraki başlatma tanımlarında aynı olan " "bir disk dosyası değil" -#: vrtManager/instance.py:2292 +#: vrtManager/instance.py:2293 #, python-format msgid "%(dev)s does not move: only writable raw and qcow2 disks do" msgstr "%(dev)s taşınmaz: yalnızca yazılabilir raw ve qcow2 diskler taşınır" -#: vrtManager/instance.py:2299 +#: vrtManager/instance.py:2300 #, python-format msgid "%(dev)s does not move: no storage pool has %(path)s" msgstr "%(dev)s taşınmaz: hiçbir depolama havuzunda %(path)s yok" -#: vrtManager/instance.py:2301 +#: vrtManager/instance.py:2302 #, python-format msgid "%(dev)s does not move: it has a backing file" msgstr "%(dev)s taşınmaz: temel (backing) dosyası var" -#: vrtManager/instance.py:2304 +#: vrtManager/instance.py:2305 #, python-format msgid "%(pool_name)s is not an active pool of disk files of this host" msgstr "%(pool_name)s bu sunucunun etkin bir disk dosyası havuzu değil" -#: vrtManager/instance.py:2307 +#: vrtManager/instance.py:2308 #, python-format msgid "%(dev)s is in pool %(pool_name)s already" msgstr "%(dev)s zaten %(pool_name)s havuzunda" -#: vrtManager/instance.py:2311 +#: vrtManager/instance.py:2312 #, python-format msgid "Pool %(pool_name)s already has a file %(name)s" msgstr "%(pool_name)s havuzunda zaten %(name)s dosyası var" -#: vrtManager/instance.py:2335 +#: vrtManager/instance.py:2336 #, python-format msgid "The copy of %(dev)s ended before it was complete" msgstr "%(dev)s kopyası tamamlanmadan sona erdi" -#: vrtManager/instance.py:2380 +#: vrtManager/instance.py:2381 #, python-format msgid "%(error)s; remove %(dest)s if it is there: %(cleanup_error)s" msgstr "%(error)s; varsa %(dest)s dosyasını kaldırın: %(cleanup_error)s" -#: vrtManager/instance.py:2382 +#: vrtManager/instance.py:2383 #, python-format msgid "%(error)s; the VM may use %(dest)s now: check its disk %(dev)s" msgstr "" "%(error)s; sanal makine şu anda %(dest)s dosyasını kullanıyor olabilir: " "%(dev)s diskini kontrol edin" -#: vrtManager/instance.py:2389 +#: vrtManager/instance.py:2390 #, python-format msgid "The VM has no internal snapshot named %(name)s" msgstr "Sanal makinenin %(name)s adlı dahili anlık görüntüsü yok" -#: vrtManager/instance.py:2400 +#: vrtManager/instance.py:2401 msgid "A snapshot job is still running on this VM; try again when it ends" msgstr "" "Bu sanal makinede hâlâ bir anlık görüntü işi çalışıyor; bittiğinde tekrar " "deneyin" -#: vrtManager/instance.py:2410 +#: vrtManager/instance.py:2411 msgid "Shut the VM down to revert to an internal snapshot" msgstr "Dahili bir anlık görüntüye geri dönmek için sanal makineyi kapatın" -#: vrtManager/instance.py:2497 +#: vrtManager/instance.py:2498 msgid "A VM with a host's or an external TPM is not cloned; remove it first" msgstr "" "Ana makinenin ya da harici bir TPM'i olan sanal makine klonlanmaz; önce onu " "kaldırın" -#: vrtManager/instance.py:2527 +#: vrtManager/instance.py:2528 msgid "Cannot clone a VM whose NVRAM is not a file" msgstr "NVRAM'i dosya olmayan bir sanal makine klonlanamaz" -#: vrtManager/instance.py:2597 +#: vrtManager/instance.py:2598 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(path)s" msgstr "" "Klonlama başarısız oldu (%(err)s); bu kopyaları elle kaldırın: %(path)s" -#: vrtManager/instance.py:2608 +#: vrtManager/instance.py:2609 msgid "Shut the VM down before cloning it" msgstr "Klonlamadan önce sanal makineyi kapatın" -#: vrtManager/instance.py:2662 +#: vrtManager/instance.py:2663 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(leftovers)s" msgstr "" "Klonlama başarısız oldu (%(err)s); bu kopyaları elle kaldırın: %(leftovers)s" -#: vrtManager/instance.py:2673 +#: vrtManager/instance.py:2674 msgid "Live clone needs libvirt 11.10 or later; shut the VM down to clone it" msgstr "" "Canlı klonlama libvirt 11.10 veya sonrasını gerektirir; klonlamak için sanal " "makineyi kapatın" -#: vrtManager/instance.py:2676 +#: vrtManager/instance.py:2677 msgid "A VM with a TPM is cloned only shut down" msgstr "TPM'i olan bir sanal makine yalnızca kapalıyken klonlanır" -#: vrtManager/instance.py:2679 +#: vrtManager/instance.py:2680 #, python-format msgid "Disk %(dev)s is not a local file; shut the VM down to clone it" msgstr "" "Disk %(dev)s yerel bir dosya değil; klonlamak için sanal makineyi kapatın" -#: vrtManager/instance.py:2681 +#: vrtManager/instance.py:2682 #, python-format msgid "Disk %(dev)s is shareable; shut the VM down to clone it" msgstr "Disk %(dev)s paylaşılabilir; klonlamak için sanal makineyi kapatın" -#: vrtManager/instance.py:2686 +#: vrtManager/instance.py:2687 #, python-format msgid "Disk %(dev)s changes at the next start; shut the VM down to clone it" msgstr "" "Disk %(dev)s sonraki başlatmada değişiyor; klonlamak için sanal makineyi " "kapatın" -#: vrtManager/instance.py:2688 +#: vrtManager/instance.py:2689 msgid "Another job is running on the VM; clone it when that ends" msgstr "Sanal makinede başka bir iş çalışıyor; o bittiğinde klonlayın" -#: vrtManager/instance.py:2714 +#: vrtManager/instance.py:2715 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the clone needs %(size).1f GiB" @@ -9891,25 +9893,25 @@ msgstr "" "gerektiriyor (kopyalanan diskler, artı bunların %%%(percent)g kadarı, en az " "%(minimum)g GiB)" -#: vrtManager/instance.py:2731 +#: vrtManager/instance.py:2732 #, python-format msgid "Volume %(name)s already exists in storage pool %(pool)s" msgstr "%(name)s birimi %(pool)s depolama havuzunda zaten var" -#: vrtManager/instance.py:2885 +#: vrtManager/instance.py:2886 msgid "A network interface that is a host device is removed in the XML editor" msgstr "Sunucu aygıtı olan bir ağ arabirimi XML düzenleyicide kaldırılır" -#: vrtManager/instance.py:2901 +#: vrtManager/instance.py:2902 #, python-format msgid "No network interface with MAC %(old_mac)s" msgstr "MAC adresi %(old_mac)s olan ağ arabirimi yok" -#: vrtManager/instance.py:2904 +#: vrtManager/instance.py:2905 msgid "A network interface that is a host device is changed in the XML editor" msgstr "Sunucu aygıtı olan bir ağ arabirimi XML düzenleyicide değiştirilir" -#: vrtManager/instance.py:2998 +#: vrtManager/instance.py:2999 msgid "" "A VM changes its PCI devices while it runs, or is shut off without a saved " "state" @@ -9917,43 +9919,43 @@ msgstr "" "Sanal makine PCI aygıtlarını çalışırken veya kaydedilmiş durumu olmadan " "kapalıyken değiştirir" -#: vrtManager/instance.py:3019 +#: vrtManager/instance.py:3020 #, python-format msgid "%(err)s; whether the VM has %(device)s now is not known" msgstr "%(err)s; sanal makinede şu anda %(device)s olup olmadığı bilinmiyor" -#: vrtManager/instance.py:3021 +#: vrtManager/instance.py:3022 #, python-format msgid "%(err)s; %(device)s: the VM is not running, its next start has it" msgstr "%(err)s; %(device)s: sanal makine çalışmıyor, sonraki başlatmada var" -#: vrtManager/instance.py:3022 +#: vrtManager/instance.py:3023 #, python-format msgid "" "%(err)s; %(device)s: the VM is not running, its next start does not have it" msgstr "%(err)s; %(device)s: sanal makine çalışmıyor, sonraki başlatmada yok" -#: vrtManager/instance.py:3023 +#: vrtManager/instance.py:3024 #, python-format msgid "%(err)s; %(device)s: the running VM has it, its next start has it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede var, sonraki başlatmada var" -#: vrtManager/instance.py:3024 +#: vrtManager/instance.py:3025 #, python-format msgid "" "%(err)s; %(device)s: the running VM has it, its next start does not have it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede var, sonraki başlatmada yok" -#: vrtManager/instance.py:3025 +#: vrtManager/instance.py:3026 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start has it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede yok, sonraki başlatmada var" -#: vrtManager/instance.py:3027 +#: vrtManager/instance.py:3028 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start does not" @@ -9961,48 +9963,48 @@ msgid "" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede yok, sonraki başlatmada yok" -#: vrtManager/instance.py:3061 +#: vrtManager/instance.py:3062 #, python-format msgid "The VM has no PCI device %(address)s" msgstr "Sanal makinede %(address)s PCI aygıtı yok" -#: vrtManager/instance.py:3082 +#: vrtManager/instance.py:3083 msgid "The VM has no USB controller" msgstr "Sanal makinede USB denetleyicisi yok" -#: vrtManager/instance.py:3116 +#: vrtManager/instance.py:3117 msgid "The VM has no such USB device" msgstr "Sanal makinede böyle bir USB aygıtı yok" -#: vrtManager/instance.py:3130 +#: vrtManager/instance.py:3131 #, python-format msgid "The VM has no network interface %(mac)s" msgstr "Sanal makinede %(mac)s ağ arabirimi yok" -#: vrtManager/instance.py:3161 +#: vrtManager/instance.py:3162 msgid "The VM has its own RNG device: change it in the XML editor" msgstr "" "Sanal makinenin kendi RNG aygıtı var: bunu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:3188 +#: vrtManager/instance.py:3189 msgid "The VM has its own TPM: change it in the XML editor" msgstr "Sanal makinenin kendi TPM'i var: bunu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:3207 +#: vrtManager/instance.py:3208 #, python-format msgid "Unknown crash action %(action)s" msgstr "Bilinmeyen çökme eylemi %(action)s" -#: vrtManager/instance.py:3234 +#: vrtManager/instance.py:3235 #, python-format msgid "Network interface %(mac)s is not in the definition" msgstr "%(mac)s ağ arayüzü tanımda yok" -#: vrtManager/instance.py:3325 +#: vrtManager/instance.py:3326 msgid "The guest agent did not answer in time; nothing was changed" msgstr "Konuk ajanı zamanında yanıt vermedi; hiçbir şey değiştirilmedi" -#: vrtManager/instance.py:3328 +#: vrtManager/instance.py:3329 msgid "The VM runs Windows: its guest agent sets no root password or SSH key" msgstr "" "Sanal makinede Windows çalışıyor: konuk ajanı root parolası ya da SSH " diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index e2b8b8bd..49e1c44c 100644 Binary files a/locale/zh/LC_MESSAGES/django.mo and b/locale/zh/LC_MESSAGES/django.mo differ diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index 2c7a7680..eb85ff04 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-13 13:07+0000\n" +"POT-Creation-Date: 2026-11-13 19:25+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -1910,24 +1910,24 @@ msgstr "" "主机 /etc/default/webvirt-gstfsd 中的 GSTFSD_KEY:面板用它为已关机的虚拟机设置 root 密码和 SSH " "密钥;留空:无法在此设置" -#: computes/models.py:179 +#: computes/models.py:180 #, python-format msgid "This host is already added as %(name)s" msgstr "此主机已作为 %(name)s 添加" -#: computes/models.py:182 +#: computes/models.py:183 #, python-format msgid "" "The panel cannot reach the host to tell that its VMs are there: %(error)s" msgstr "面板无法连接该主机,因此无法确认其虚拟机在那里:%(error)s" -#: computes/models.py:189 +#: computes/models.py:190 msgid "" "The host its VMs are on is not known yet: change the connection when the " "panel has reached the host at its current one" msgstr "其虚拟机所在的主机尚不明确:请在面板通过当前连接访问到该主机后再更改连接" -#: computes/models.py:192 +#: computes/models.py:193 msgid "This is another host than the one its VMs are on: add it as a new host" msgstr "这不是其虚拟机所在的主机:请将其添加为新主机" @@ -2414,17 +2414,17 @@ msgid "" "/etc/default/webvirt-gstfsd" msgstr "请输入主机 /etc/default/webvirt-gstfsd 中 GSTFSD_KEY 的 64 个十六进制字符" -#: computes/views.py:122 +#: computes/views.py:148 #, python-format msgid "The host did not answer within %(seconds)s seconds" msgstr "主机未在 %(seconds)s 秒内响应" -#: computes/views.py:210 +#: computes/views.py:236 #, python-format msgid "The host was saved, but the panel cannot connect to it: %(error)s" msgstr "主机已保存,但面板无法连接到它:%(error)s" -#: computes/views.py:266 +#: computes/views.py:292 #, python-format msgid "" "Its VMs keep running on the host and leave the panel; their owners are kept " @@ -2741,8 +2741,9 @@ msgid "Enter the new password." msgstr "请输入新密码。" #: instances/forms.py:92 -msgid "A VNC password takes at most 8 bytes." -msgstr "VNC 密码最多 8 个字节。" +msgid "" +"A VNC password takes up to 8 letters, digits or symbols, without accents." +msgstr "VNC 密码最多 8 个字母、数字或符号,不能有带重音的字母。" #: instances/forms.py:98 msgid "" @@ -2825,7 +2826,7 @@ msgstr "虚拟机未定义;请检查这些卷,然后处理此任务:%(volu msgid "Delete snapshot" msgstr "删除快照" -#: instances/jobs.py:356 vrtManager/instance.py:2388 +#: instances/jobs.py:356 vrtManager/instance.py:2389 #, python-format msgid "The VM has no external snapshot named %(name)s" msgstr "虚拟机没有名为 %(name)s 的外部快照" @@ -2857,7 +2858,7 @@ msgstr "虚拟机已不在运行该任务的计算节点上" msgid "Take snapshot" msgstr "创建快照" -#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:1979 +#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:1980 #, python-format msgid "A snapshot named %(name)s already exists" msgstr "名为 %(name)s 的快照已存在" @@ -2996,12 +2997,12 @@ msgstr "镜像已存在。请检查卷或更改虚拟机名称" msgid "Each network card needs a network" msgstr "每个网卡都需要一个网络" -#: instances/jobs.py:851 vrtManager/instance.py:2846 +#: instances/jobs.py:851 vrtManager/instance.py:2847 #, python-format msgid "This host has no network %(name)s" msgstr "此主机没有网络 %(name)s" -#: instances/jobs.py:853 vrtManager/instance.py:2848 +#: instances/jobs.py:853 vrtManager/instance.py:2849 #, python-format msgid "This host has no network filter %(name)s" msgstr "此主机没有网络过滤器 %(name)s" @@ -3023,7 +3024,7 @@ msgstr "磁盘缓存 %(cache)s 与设置中的原生 (native) 磁盘 I/O 不兼 msgid "Create VM" msgstr "创建虚拟机" -#: instances/jobs.py:910 instances/jobs.py:956 instances/views.py:2539 +#: instances/jobs.py:910 instances/jobs.py:956 instances/views.py:2546 msgid "A virtual machine with this name already exists" msgstr "同名虚拟机已存在" @@ -3071,7 +3072,7 @@ msgstr "cloud-init 种子需要为磁盘使用目录类型的存储池" msgid "This host offers no firmware %(firmware)s" msgstr "此主机不提供固件 %(firmware)s" -#: instances/jobs.py:939 vrtManager/instance.py:3195 +#: instances/jobs.py:939 vrtManager/instance.py:3196 msgid "This host offers no TPM 2.0: install swtpm on it" msgstr "此主机不提供 TPM 2.0:请在主机上安装 swtpm" @@ -3371,7 +3372,7 @@ msgid "Disk source" msgstr "磁盘来源" #: instances/templates/add_instance_volume.html:21 -#: instances/templates/create_instance_w2.html:134 instances/views.py:2559 +#: instances/templates/create_instance_w2.html:134 instances/views.py:2566 msgid "New disk" msgstr "新磁盘" @@ -3745,7 +3746,7 @@ msgstr "自定义 CPU 型号" msgid "Size (GiB)" msgstr "大小(GiB)" -#: instances/templates/create_instance_w2.html:161 instances/views.py:2560 +#: instances/templates/create_instance_w2.html:161 instances/views.py:2567 msgid "Existing volumes" msgstr "已有卷" @@ -3781,7 +3782,7 @@ msgstr "设备" msgid "Remove" msgstr "移除" -#: instances/templates/create_instance_w2.html:194 instances/views.py:2561 +#: instances/templates/create_instance_w2.html:194 instances/views.py:2568 msgid "Clone from template" msgstr "从模板克隆" @@ -4305,7 +4306,7 @@ msgid "Add USB device" msgstr "添加 USB 设备" #: instances/templates/instances/host_devices_form.html:18 -#: vrtManager/instance.py:3099 +#: vrtManager/instance.py:3100 msgid "" "A VM with a saved state does not change its USB devices: start it, or start " "it without its saved state" @@ -5348,8 +5349,8 @@ msgid "No password is set." msgstr "未设置密码。" #: instances/templates/instances/settings_tab.html:748 -msgid "Up to 8 characters; an accented letter counts as two." -msgstr "最多 8 个字符;带重音的字母计为两个。" +msgid "Up to 8 letters, digits or symbols, without accents." +msgstr "最多 8 个字母、数字或符号,不能有带重音的字母。" #: instances/templates/instances/settings_tab.html:759 msgid "Save console settings" @@ -6171,7 +6172,7 @@ msgstr "卷已成功更改。" msgid "Disk %(dev)s is not a storage volume of this instance" msgstr "磁盘 %(dev)s 不是此虚拟机的存储卷" -#: instances/views.py:1554 vrtManager/instance.py:2398 +#: instances/views.py:1554 vrtManager/instance.py:2399 msgid "The VM has a saved state; start it or remove the saved state first" msgstr "虚拟机有保存的状态;请先启动它或删除保存的状态" @@ -6241,7 +6242,7 @@ msgstr "启动顺序已成功更改。" msgid "The XML is empty" msgstr "XML 为空" -#: instances/views.py:1903 instances/views.py:2550 +#: instances/views.py:1903 instances/views.py:2557 #, python-format msgid "The XML is not well-formed: %(error)s" msgstr "XML 格式不正确:%(error)s" @@ -6380,55 +6381,55 @@ msgstr "请关闭虚拟机以更改其是否为模板。" msgid "%(quota)s: '%(instance_name)s' stays a template." msgstr "%(quota)s:“%(instance_name)s”仍为模板。" -#: instances/views.py:2537 +#: instances/views.py:2544 msgid "The XML has no name" msgstr "XML 中没有名称" -#: instances/views.py:2552 webvirtcloud/middleware.py:156 +#: instances/views.py:2559 webvirtcloud/middleware.py:156 #, python-format msgid "libvirt Error - %(exception)s" msgstr "libvirt 错误 - %(exception)s" -#: instances/views.py:2559 +#: instances/views.py:2566 msgid "An empty disk of the size you set" msgstr "按设定大小创建的空磁盘" -#: instances/views.py:2560 +#: instances/views.py:2567 msgid "Volumes already in a pool" msgstr "存储池中已有的卷" -#: instances/views.py:2561 +#: instances/views.py:2568 msgid "A copy of a template volume" msgstr "模板卷的副本" -#: instances/views.py:2639 +#: instances/views.py:2646 msgid "" "This host has no running storage pool for the VM's disks: add or start one on" " its Storage page." msgstr "此主机没有可用于虚拟机磁盘的运行中存储池:请在其“存储”页面添加或启动一个。" -#: instances/views.py:2641 +#: instances/views.py:2648 msgid "This host has no network for the VM: add one on its Networks page." msgstr "此主机没有可供虚拟机使用的网络:请在其“网络”页面添加一个。" -#: instances/views.py:2673 +#: instances/views.py:2680 #, python-format msgid "The machine type is q35, not %(machine)s: UEFI Secure Boot needs it" msgstr "机器类型为 q35,而不是 %(machine)s:UEFI 安全启动需要它" -#: instances/views.py:2700 +#: instances/views.py:2707 msgid "Flavor Created" msgstr "规格已创建" -#: instances/views.py:2708 +#: instances/views.py:2715 msgid "Create Flavor" msgstr "创建规格" -#: instances/views.py:2720 +#: instances/views.py:2727 msgid "Flavor Deleted" msgstr "规格已删除" -#: instances/views.py:2726 +#: instances/views.py:2733 msgid "Only the size template goes; VMs made from it keep their size." msgstr "仅删除此规格;由它创建的虚拟机保持其大小。" @@ -9075,83 +9076,83 @@ msgstr "磁盘 %(target_dev)s 不在虚拟机的定义中" msgid "Please shutdown the instance then try to enable vCPU hotplug" msgstr "请先关闭虚拟机,再启用 vCPU 热插拔" -#: vrtManager/instance.py:1761 +#: vrtManager/instance.py:1762 msgid "The VM has no video card" msgstr "虚拟机没有显卡" -#: vrtManager/instance.py:1771 +#: vrtManager/instance.py:1772 #, python-format msgid "" "The VM's CPU topology has %(count)s vCPUs: change it in the XML editor to set" " another maximum" msgstr "该虚拟机的 CPU 拓扑为 %(count)s 个 vCPU:要设置其他最大值,请在 XML 编辑器中修改拓扑" -#: vrtManager/instance.py:1797 +#: vrtManager/instance.py:1798 #, python-format msgid "The VM's next start has a maximum memory of %(max)s MiB" msgstr "虚拟机下次启动时的最大内存为 %(max)s MiB" -#: vrtManager/instance.py:1938 +#: vrtManager/instance.py:1939 msgid "" "The VM has external snapshots; internal snapshots cannot be mixed with them" msgstr "虚拟机有外部快照;内部快照不能与其混用" -#: vrtManager/instance.py:1970 +#: vrtManager/instance.py:1971 msgid "A snapshot with memory is not quiesced; it keeps the whole guest state" msgstr "含内存的快照不会静默文件系统;它保存整个客户机状态" -#: vrtManager/instance.py:1972 +#: vrtManager/instance.py:1973 msgid "Only a running VM's file systems can be frozen" msgstr "只有运行中的虚拟机的文件系统可以冻结" -#: vrtManager/instance.py:1974 +#: vrtManager/instance.py:1975 msgid "The QEMU guest agent is not connected; it freezes the file systems" msgstr "QEMU 客户机代理未连接;文件系统由它冻结" -#: vrtManager/instance.py:1977 +#: vrtManager/instance.py:1978 msgid "" "The VM has internal snapshots; external snapshots cannot be mixed with them" msgstr "虚拟机有内部快照;外部快照不能与其混用" -#: vrtManager/instance.py:1982 +#: vrtManager/instance.py:1983 msgid "Newer snapshots exist after the last revert; delete them first" msgstr "上次还原后存在更新的快照;请先删除它们" -#: vrtManager/instance.py:1985 +#: vrtManager/instance.py:1986 msgid "No snapshot is current; revert to a snapshot first" msgstr "没有当前快照;请先还原到某个快照" -#: vrtManager/instance.py:1991 +#: vrtManager/instance.py:1992 #, python-format msgid "Eject the media from %(dev)s first" msgstr "请先弹出 %(dev)s 中的介质" -#: vrtManager/instance.py:1993 +#: vrtManager/instance.py:1994 #, python-format msgid "Disk %(dev)s is not a file; external snapshots need file disks" msgstr "磁盘 %(dev)s 不是文件;外部快照需要文件磁盘" -#: vrtManager/instance.py:2001 +#: vrtManager/instance.py:2002 #, python-format msgid "" "The storage pools could not be refreshed, so their free space is unknown: " "%(err)s" msgstr "无法刷新存储池,其可用空间未知:%(err)s" -#: vrtManager/instance.py:2022 +#: vrtManager/instance.py:2023 msgid "Memory is saved only from a running VM" msgstr "只能保存运行中的虚拟机的内存" -#: vrtManager/instance.py:2024 +#: vrtManager/instance.py:2025 msgid "The VM has no disk to keep its memory next to" msgstr "虚拟机没有可存放其内存的磁盘" -#: vrtManager/instance.py:2028 +#: vrtManager/instance.py:2029 #, python-format msgid "%(disk)s is not in a storage pool; memory is saved only into one" msgstr "%(disk)s 不在存储池中;内存只能保存到存储池中" -#: vrtManager/instance.py:2059 +#: vrtManager/instance.py:2060 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the snapshot needs %(size).1f " @@ -9161,151 +9162,151 @@ msgstr "" "存储池 %(pool)s 可用 %(free).1f GiB;快照需要 %(size).1f GiB(其中虚拟机磁盘的 %(percent)g%%,至少 " "%(minimum)g GiB,若保存内存则另加内存)" -#: vrtManager/instance.py:2077 +#: vrtManager/instance.py:2078 msgid "" "This snapshot was taken by an older version on a UEFI VM and cannot be " "reverted; delete it instead" msgstr "此快照由旧版本在 UEFI 虚拟机上创建,无法还原;请将其删除" -#: vrtManager/instance.py:2107 +#: vrtManager/instance.py:2108 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is " "running." msgstr "还原两次失败;请稍后重试(%(error)s)。虚拟机正在运行。" -#: vrtManager/instance.py:2109 +#: vrtManager/instance.py:2110 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is shut " "off." msgstr "还原两次失败;请稍后重试(%(error)s)。虚拟机已关机。" -#: vrtManager/instance.py:2277 +#: vrtManager/instance.py:2278 msgid "A disk moves when its VM is defined and running, paused or shut off" msgstr "仅当虚拟机已定义且处于运行、暂停或关机状态时才能移动磁盘" -#: vrtManager/instance.py:2279 +#: vrtManager/instance.py:2280 msgid "" "A disk of a VM with snapshots, a saved state or a running block job does not " "move" msgstr "有快照、保存的状态或正在运行块任务的虚拟机的磁盘不能移动" -#: vrtManager/instance.py:2287 +#: vrtManager/instance.py:2288 #, python-format msgid "" "%(dev)s is not a disk file of the VM, the same in its running and next " "start's definition" msgstr "%(dev)s 不是该虚拟机在运行中的定义和下次启动定义中相同的磁盘文件" -#: vrtManager/instance.py:2292 +#: vrtManager/instance.py:2293 #, python-format msgid "%(dev)s does not move: only writable raw and qcow2 disks do" msgstr "%(dev)s 不能移动:只能移动可写的 raw 和 qcow2 磁盘" -#: vrtManager/instance.py:2299 +#: vrtManager/instance.py:2300 #, python-format msgid "%(dev)s does not move: no storage pool has %(path)s" msgstr "%(dev)s 不能移动:没有存储池包含 %(path)s" -#: vrtManager/instance.py:2301 +#: vrtManager/instance.py:2302 #, python-format msgid "%(dev)s does not move: it has a backing file" msgstr "%(dev)s 不能移动:它有后备文件" -#: vrtManager/instance.py:2304 +#: vrtManager/instance.py:2305 #, python-format msgid "%(pool_name)s is not an active pool of disk files of this host" msgstr "%(pool_name)s 不是此主机上活动的磁盘文件存储池" -#: vrtManager/instance.py:2307 +#: vrtManager/instance.py:2308 #, python-format msgid "%(dev)s is in pool %(pool_name)s already" msgstr "%(dev)s 已在存储池 %(pool_name)s 中" -#: vrtManager/instance.py:2311 +#: vrtManager/instance.py:2312 #, python-format msgid "Pool %(pool_name)s already has a file %(name)s" msgstr "存储池 %(pool_name)s 中已有文件 %(name)s" -#: vrtManager/instance.py:2335 +#: vrtManager/instance.py:2336 #, python-format msgid "The copy of %(dev)s ended before it was complete" msgstr "%(dev)s 的复制在完成前结束" -#: vrtManager/instance.py:2380 +#: vrtManager/instance.py:2381 #, python-format msgid "%(error)s; remove %(dest)s if it is there: %(cleanup_error)s" msgstr "%(error)s;如果 %(dest)s 存在请将其删除:%(cleanup_error)s" -#: vrtManager/instance.py:2382 +#: vrtManager/instance.py:2383 #, python-format msgid "%(error)s; the VM may use %(dest)s now: check its disk %(dev)s" msgstr "%(error)s;虚拟机现在可能在使用 %(dest)s:请检查其磁盘 %(dev)s" -#: vrtManager/instance.py:2389 +#: vrtManager/instance.py:2390 #, python-format msgid "The VM has no internal snapshot named %(name)s" msgstr "虚拟机没有名为 %(name)s 的内部快照" -#: vrtManager/instance.py:2400 +#: vrtManager/instance.py:2401 msgid "A snapshot job is still running on this VM; try again when it ends" msgstr "此虚拟机上仍有快照任务在运行;请在其结束后重试" -#: vrtManager/instance.py:2410 +#: vrtManager/instance.py:2411 msgid "Shut the VM down to revert to an internal snapshot" msgstr "请关闭虚拟机后再还原到内部快照" -#: vrtManager/instance.py:2497 +#: vrtManager/instance.py:2498 msgid "A VM with a host's or an external TPM is not cloned; remove it first" msgstr "带有主机 TPM 或外部 TPM 的虚拟机无法克隆;请先将其移除" -#: vrtManager/instance.py:2527 +#: vrtManager/instance.py:2528 msgid "Cannot clone a VM whose NVRAM is not a file" msgstr "NVRAM 不是文件的虚拟机无法克隆" -#: vrtManager/instance.py:2597 +#: vrtManager/instance.py:2598 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(path)s" msgstr "克隆失败(%(err)s);请手动删除这些副本:%(path)s" -#: vrtManager/instance.py:2608 +#: vrtManager/instance.py:2609 msgid "Shut the VM down before cloning it" msgstr "请先关闭虚拟机再克隆" -#: vrtManager/instance.py:2662 +#: vrtManager/instance.py:2663 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(leftovers)s" msgstr "克隆失败(%(err)s);请手动删除这些副本:%(leftovers)s" -#: vrtManager/instance.py:2673 +#: vrtManager/instance.py:2674 msgid "Live clone needs libvirt 11.10 or later; shut the VM down to clone it" msgstr "在线克隆需要 libvirt 11.10 或更高版本;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2676 +#: vrtManager/instance.py:2677 msgid "A VM with a TPM is cloned only shut down" msgstr "带 TPM 的虚拟机只能在关机时克隆" -#: vrtManager/instance.py:2679 +#: vrtManager/instance.py:2680 #, python-format msgid "Disk %(dev)s is not a local file; shut the VM down to clone it" msgstr "磁盘 %(dev)s 不是本地文件;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2681 +#: vrtManager/instance.py:2682 #, python-format msgid "Disk %(dev)s is shareable; shut the VM down to clone it" msgstr "磁盘 %(dev)s 是可共享的;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2686 +#: vrtManager/instance.py:2687 #, python-format msgid "Disk %(dev)s changes at the next start; shut the VM down to clone it" msgstr "磁盘 %(dev)s 在下次启动时会改变;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2688 +#: vrtManager/instance.py:2689 msgid "Another job is running on the VM; clone it when that ends" msgstr "虚拟机上有另一个任务正在运行;请在其结束后再克隆" -#: vrtManager/instance.py:2714 +#: vrtManager/instance.py:2715 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the clone needs %(size).1f GiB" @@ -9314,111 +9315,111 @@ msgstr "" "存储池 %(pool)s 可用 %(free).1f GiB;克隆需要 %(size).1f GiB(复制的磁盘,再加其 %(percent)g%%,至少" " %(minimum)g GiB)" -#: vrtManager/instance.py:2731 +#: vrtManager/instance.py:2732 #, python-format msgid "Volume %(name)s already exists in storage pool %(pool)s" msgstr "卷 %(name)s 已存在于存储池 %(pool)s 中" -#: vrtManager/instance.py:2885 +#: vrtManager/instance.py:2886 msgid "A network interface that is a host device is removed in the XML editor" msgstr "作为主机设备的网络接口需在 XML 编辑器中删除" -#: vrtManager/instance.py:2901 +#: vrtManager/instance.py:2902 #, python-format msgid "No network interface with MAC %(old_mac)s" msgstr "没有 MAC 为 %(old_mac)s 的网络接口" -#: vrtManager/instance.py:2904 +#: vrtManager/instance.py:2905 msgid "A network interface that is a host device is changed in the XML editor" msgstr "作为主机设备的网络接口需在 XML 编辑器中修改" -#: vrtManager/instance.py:2998 +#: vrtManager/instance.py:2999 msgid "" "A VM changes its PCI devices while it runs, or is shut off without a saved " "state" msgstr "虚拟机只能在运行时或无保存的状态的关机时更改其 PCI 设备" -#: vrtManager/instance.py:3019 +#: vrtManager/instance.py:3020 #, python-format msgid "%(err)s; whether the VM has %(device)s now is not known" msgstr "%(err)s;虚拟机现在是否有 %(device)s 未知" -#: vrtManager/instance.py:3021 +#: vrtManager/instance.py:3022 #, python-format msgid "%(err)s; %(device)s: the VM is not running, its next start has it" msgstr "%(err)s;%(device)s:虚拟机未运行,下次启动时有它" -#: vrtManager/instance.py:3022 +#: vrtManager/instance.py:3023 #, python-format msgid "" "%(err)s; %(device)s: the VM is not running, its next start does not have it" msgstr "%(err)s;%(device)s:虚拟机未运行,下次启动时没有它" -#: vrtManager/instance.py:3023 +#: vrtManager/instance.py:3024 #, python-format msgid "%(err)s; %(device)s: the running VM has it, its next start has it" msgstr "%(err)s;%(device)s:运行中的虚拟机有它,下次启动时有它" -#: vrtManager/instance.py:3024 +#: vrtManager/instance.py:3025 #, python-format msgid "" "%(err)s; %(device)s: the running VM has it, its next start does not have it" msgstr "%(err)s;%(device)s:运行中的虚拟机有它,下次启动时没有它" -#: vrtManager/instance.py:3025 +#: vrtManager/instance.py:3026 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start has it" msgstr "%(err)s;%(device)s:运行中的虚拟机没有它,下次启动时有它" -#: vrtManager/instance.py:3027 +#: vrtManager/instance.py:3028 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start does not" " have it" msgstr "%(err)s;%(device)s:运行中的虚拟机没有它,下次启动时没有它" -#: vrtManager/instance.py:3061 +#: vrtManager/instance.py:3062 #, python-format msgid "The VM has no PCI device %(address)s" msgstr "虚拟机没有 PCI 设备 %(address)s" -#: vrtManager/instance.py:3082 +#: vrtManager/instance.py:3083 msgid "The VM has no USB controller" msgstr "虚拟机没有 USB 控制器" -#: vrtManager/instance.py:3116 +#: vrtManager/instance.py:3117 msgid "The VM has no such USB device" msgstr "虚拟机没有此 USB 设备" -#: vrtManager/instance.py:3130 +#: vrtManager/instance.py:3131 #, python-format msgid "The VM has no network interface %(mac)s" msgstr "虚拟机没有网络接口 %(mac)s" -#: vrtManager/instance.py:3161 +#: vrtManager/instance.py:3162 msgid "The VM has its own RNG device: change it in the XML editor" msgstr "虚拟机有自己的 RNG 设备:请在 XML 编辑器中修改" -#: vrtManager/instance.py:3188 +#: vrtManager/instance.py:3189 msgid "The VM has its own TPM: change it in the XML editor" msgstr "虚拟机有自己的 TPM:请在 XML 编辑器中修改" -#: vrtManager/instance.py:3207 +#: vrtManager/instance.py:3208 #, python-format msgid "Unknown crash action %(action)s" msgstr "未知的崩溃操作 %(action)s" -#: vrtManager/instance.py:3234 +#: vrtManager/instance.py:3235 #, python-format msgid "Network interface %(mac)s is not in the definition" msgstr "网络接口 %(mac)s 不在定义中" -#: vrtManager/instance.py:3325 +#: vrtManager/instance.py:3326 msgid "The guest agent did not answer in time; nothing was changed" msgstr "客户机代理未及时响应;未做任何更改" -#: vrtManager/instance.py:3328 +#: vrtManager/instance.py:3329 msgid "The VM runs Windows: its guest agent sets no root password or SSH key" msgstr "该虚拟机运行 Windows:其客户机代理不能设置 root 密码或 SSH 密钥" diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 33779478..d064b589 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -1706,8 +1706,9 @@ class wvmInstance(wvmConnect): if passwd: graphic.set("passwd", passwd) else: - with contextlib.suppress(Exception): - graphic.attrib.pop("passwd") + graphic.attrib.pop("passwd", None) + # an expiry set elsewhere would leave the new password unusable + graphic.attrib.pop("passwdValidTo", None) newxml = etree.tostring(root).decode() return self._defineXML(newxml) @@ -2521,6 +2522,7 @@ class wvmInstance(wvmConnect): # the clone's console gets a password of its own: one copied from the source would open both for graphics in tree.findall("devices/graphics[@type='vnc']"): graphics.set("passwd", util.randomPasswd(8)) # the length VNC allows + graphics.attrib.pop("passwdValidTo", None) # an expired source's would leave it unusable nvram = tree.find("os/nvram") if nvram is not None and nvram.get("type", "file") != "file": diff --git a/vrtManager/tests/test_clone_console.py b/vrtManager/tests/test_clone_console.py index b3228130..0325ce0f 100644 --- a/vrtManager/tests/test_clone_console.py +++ b/vrtManager/tests/test_clone_console.py @@ -4,6 +4,8 @@ Its NIC filters keep no address of the source's.""" import unittest +from lxml import etree + from vrtManager.instance import wvmInstance @@ -23,6 +25,10 @@ class CloneConsoleTestCase(unittest.TestCase): self.assertEqual(len(passwords), 5) self.assertTrue(all(len(p) == 8 for p in passwords)) # the length VNC allows + def test_a_clone_keeps_no_password_expiry_of_its_source(self): + graphics = clone_graphics("passwd='shared12' passwdValidTo='2000-01-01T00:00:00'") + self.assertIsNone(graphics.get("passwdValidTo")) + def test_a_source_without_a_password_gives_a_clone_with_one(self): self.assertEqual(len(clone_graphics("").get("passwd")), 8) @@ -48,3 +54,18 @@ class CloneConsoleTestCase(unittest.TestCase): tree, _ = p._clone_definition({"name": "copy", "clone-net-mac-0": "52:54:00:00:00:02"}, "abababab-0000-1111-2222-333333333333") self.assertEqual(tree.xpath("devices/interface/filterref/parameter/@name"), ["IP", "IPV6", "CTRL_IP_LEARNING"]) + + +class ConsolePasswordTestCase(unittest.TestCase): + def test_a_new_password_drops_an_expiry_set_elsewhere(self): + # an expired passwdValidTo would leave the new password unusable + p = wvmInstance.__new__(wvmInstance) + p._XMLDesc = lambda flags: """""" + for password in ("new12345", ""): + with self.subTest(password=password): + defined = [] + p._defineXML = defined.append + p.set_console_passwd(password) + graphic = etree.fromstring(defined[0]).find("devices/graphics") + self.assertEqual((graphic.get("passwd"), graphic.get("passwdValidTo")), (password or None, None))