[PATCH] Fix default keyring creation
Guido Günther
agx at sigxcpu.org
Mon Dec 6 09:25:59 UTC 2010
Origin: Upstream, http://hg.fedorahosted.org/hg/virt-manager/rev/416206ef3db0bd2c60c63b7cfda3c47438bcf6e5
---
src/virtManager/keyring.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/virtManager/keyring.py b/src/virtManager/keyring.py
index d232e62..5f06d75 100644
--- a/src/virtManager/keyring.py
+++ b/src/virtManager/keyring.py
@@ -35,11 +35,13 @@ class vmmKeyring:
def __init__(self):
if haveKeyring:
try:
- if not("default" in gnomekeyring.list_keyring_names_sync()):
- gnomekeyring.create_sync("default", None)
self.keyring = gnomekeyring.get_default_keyring_sync()
if self.keyring == None:
- logging.warning("Failed to create default keyring")
+ self.keyring = 'default'
+ try:
+ gnomekeyring.create_sync(self.keyring, None)
+ except gnomekeyring.AlreadyExistsError:
+ pass
except:
logging.warning(("Keyring unavailable: '%s'") % (str((sys.exc_info())[0]) + " " + str((sys.exc_info())[1])))
self.keyring = None
--
1.7.2.3
--sm4nu43k4a2Rpi4c--
More information about the Pkg-libvirt-maintainers
mailing list