connection: Drop glib usage for cache dir

Our fallback implementation is the same as glib for all usage we
care about, so don't bother with calling glib

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-01-27 04:49:54 -05:00
parent 49d16912c3
commit 156926b78d
1 changed files with 1 additions and 10 deletions

View File

@ -43,16 +43,7 @@ class VirtinstConnection(object):
@staticmethod
def get_app_cache_dir():
ret = ""
try:
# We don't want to depend on glib for virt-install
from gi.repository import GLib
ret = GLib.get_user_cache_dir()
except ImportError:
pass
if not ret:
ret = os.environ.get("XDG_CACHE_HOME")
ret = os.environ.get("XDG_CACHE_HOME")
if not ret:
ret = os.path.expanduser("~/.cache")
return os.path.join(ret, "virt-manager")