mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Don't reinvent (poorly) gconf.escape_key and friends. (Mark McLoughlin)
Was causing errors with storing per-connection preferences for remote URIs with '+' in them.
This commit is contained in:
parent
97f6cd8fdb
commit
c0c3cf0d1a
@ -116,7 +116,7 @@ class vmmConfig:
|
||||
|
||||
# Per-VM/Connection/Connection Host Option dealings
|
||||
def _perconn_helper(self, uri, pref_func, func_type, value=None):
|
||||
suffix = "connection_prefs/%s" % uri.replace("/", "-")
|
||||
suffix = "connection_prefs/%s" % gconf.escape_key(uri, len(uri))
|
||||
return self._perobj_helper(suffix, pref_func, func_type, value)
|
||||
def _perhost_helper(self, uri, pref_func, func_type, value=None):
|
||||
host = virtinst.util.get_uri_hostname(uri)
|
||||
@ -125,8 +125,8 @@ class vmmConfig:
|
||||
suffix = "connection_prefs/hosts/%s" % host
|
||||
return self._perobj_helper(suffix, pref_func, func_type, value)
|
||||
def _pervm_helper(self, uri, uuid, pref_func, func_type, value=None):
|
||||
suffix = "connection_prefs/%s/vms/%s" % (uri.replace("/", "-"),
|
||||
uuid)
|
||||
suffix = ("connection_prefs/%s/vms/%s" %
|
||||
(gconf.escape_key(uri, len(uri)), uuid))
|
||||
return self._perobj_helper(suffix, pref_func, func_type, value)
|
||||
|
||||
def _perobj_helper(self, suffix, pref_func, func_type, value=None):
|
||||
@ -206,7 +206,7 @@ class vmmConfig:
|
||||
"""
|
||||
Remove any old VM preference entries for the passed URI
|
||||
"""
|
||||
uri = uri.replace("/", "-")
|
||||
uri = gconf.escape_key(uri, len(uri))
|
||||
key = self.conf_dir + "/connection_prefs/%s/vms" % uri
|
||||
kill_vms = []
|
||||
gconf_vms = map(lambda inp: inp.split("/")[-1],
|
||||
|
Loading…
Reference in New Issue
Block a user