From 28d303627d222e54e7a8fbe21002460d2a995206 Mon Sep 17 00:00:00 2001
From: Brent Baude <bbaude(a)redhat.com>
Date: Mon, 30 Nov 2015 15:29:37 -0600
Subject: Adding small patch for memory deprecation in psutil
---
kimchi-1.5.1-psutil_memory.patch | 14 ++++++++++++++
kimchi.spec | 7 ++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 kimchi-1.5.1-psutil_memory.patch
diff --git a/kimchi-1.5.1-psutil_memory.patch b/kimchi-1.5.1-psutil_memory.patch
new file mode 100644
index 0000000..d7cb792
--- /dev/null
+++ b/kimchi-1.5.1-psutil_memory.patch
@@ -0,0 +1,14 @@
+--- kimchi-1.5.1/src/kimchi/osinfo.py.orig 2015-11-30 15:26:41.620996146 -0600
++++ kimchi-1.5.1/src/kimchi/osinfo.py 2015-11-30 15:27:07.143459217 -0600
+@@ -188,7 +188,10 @@
+ arch = _get_arch()
+
+ # Setting maxMemory of the VM, which will be equal total Host memory in Kib
+- params['max_memory'] = psutil.TOTAL_PHYMEM >> 10
++ if hasattr(psutil, 'virtual_memory'):
++ params['max_memory'] = psutil.virtual_memory().total >> 10
++ else:
++ params['max_memory'] = psutil.TOTAL_PHYMEM >> 10
+
+ # set up arch to ppc64 instead of ppc64le due to libvirt compatibility
+ if params["arch"] == "ppc64le":
diff --git a/kimchi.spec b/kimchi.spec
index 3b5e466..bc61f46 100644
--- a/kimchi.spec
+++ b/kimchi.spec
@@ -1,6 +1,6 @@
Name: kimchi
Version: 1.5.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: An HTML5-based KVM graphical interface
BuildArch: noarch
# The backend is LGPLv3 and LGPLv2+, the UI is ASL 2.0
@@ -18,6 +18,7 @@ Patch1: kimchi-1.5.1-kbd_type.patch
Patch2: kimchi-1.5.1-remove-cert-gen.patch
Patch3: kimchi-1.5.1-nofailontemplate.patch
Patch4: kimchi-1.5.1-psutil_cpu.patch
+patch5: kimchi-1.5.1-psutil_memory.patch
Requires: qemu-kvm
Requires: gettext-devel
@@ -69,6 +70,7 @@ Web server application to manage KVM/Qemu virtual machines
%patch2 -p1
%patch3 -p1
%patch4 -p0
+%patch5 -p1
%build
autoreconf -vfi
%configure
@@ -112,6 +114,9 @@ fi
%changelog
+* Mon Nov 30 2015 Brent Baude <bbaude(a)redhat.com> - 1.5.1-3
+- psutil.TOTAL_PHYMEM deprecated
+
* Thu Nov 19 2015 Brent Baude <bbaude(a)redhat.com> - 1.5.1-2
- psutil.NUM_CPUS depracted, use psutil.cpu_count() instead
--
cgit v0.11.2
http://pkgs.fedoraproject.org/cgit/kimchi.git/commit/?h=master&id=28d...