From 140ec860fefdd67c2bd52d9972b49bc454d70028 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Tue, 19 Feb 2013 16:43:58 +0400
Subject: [PATCH 01/13] CentOS 6.3 changes

---
 Makefile                                           |    9 +-
 backend/manager/conf/ca/encryptpasswd.sh           |    4 +-
 .../manager/conf/kerberos/engine-manage-domains    |   65 +++-
 .../dbscripts/upgrade/03_01_1540_add_smartcard.sql |    1 +
 .../dbscripts/upgrade/pre_upgrade/0000_config.sql  |    9 +-
 .../0040_materialized_views_extensions.sql         |    6 +
 .../engine-config/src/main/resources/engine-config |   47 ++-
 ext/apache-mime4j-core-0.7.2.jar                   |  Bin 0 -> 95536 bytes
 ext/apache-mime4j-dom-0.7.2.jar                    |  Bin 0 -> 304810 bytes
 ext/apache-mime4j-storage-0.7.2.jar                |  Bin 0 -> 30113 bytes
 ext/commons-jxpath-1.3.jar                         |  Bin 0 -> 299994 bytes
 ext/commons-logging-1.0.4.jar                      |  Bin 0 -> 38015 bytes
 ext/istack-commons-runtime-2.4.jar                 |  Bin 0 -> 21029 bytes
 ext/jtype-0.1.2.jar                                |  Bin 0 -> 32530 bytes
 packaging/fedora/engine-service.systemv            |   26 ++
 packaging/fedora/setup/basedefs.py                 |    2 +-
 packaging/fedora/setup/common_utils.py             |   17 +-
 packaging/fedora/spec/ovirt-engine.spec.in         |  406 ++++++++++++--------
 pom.xml                                            |    1 +
 19 files changed, 393 insertions(+), 200 deletions(-)
 create mode 100644 backend/manager/dbscripts/upgrade/03_01_1540_add_smartcard.sql
 create mode 100644 backend/manager/dbscripts/upgrade/pre_upgrade/0040_materialized_views_extensions.sql
 create mode 100644 ext/apache-mime4j-core-0.7.2.jar
 create mode 100644 ext/apache-mime4j-dom-0.7.2.jar
 create mode 100644 ext/apache-mime4j-storage-0.7.2.jar
 create mode 100644 ext/commons-jxpath-1.3.jar
 create mode 100644 ext/commons-logging-1.0.4.jar
 create mode 100644 ext/istack-commons-runtime-2.4.jar
 create mode 100644 ext/jtype-0.1.2.jar
 create mode 100644 packaging/fedora/engine-service.systemv

diff --git a/Makefile b/Makefile
index cd2aa3b..ad0e8b1 100644
--- a/Makefile
+++ b/Makefile
@@ -406,7 +406,14 @@ install_misc:
 	install -m 644 backend/manager/conf/engine.conf.defaults $(DESTDIR)$(DATA_DIR)/conf
 	install -m 755 packaging/resources/ovirtlogrot.sh ${DESTDIR}$(DATA_DIR)/scripts/
 	install -m 755 packaging/resources/ovirt-cron ${DESTDIR}$(SYSCONF_DIR)/cron.daily/
-
+	#Copy additional jars
+	install -m 644 ext/commons-jxpath-1.3.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
+	install -m 644 ext/commons-logging-1.0.4.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
+	install -m 644 ext/jtype-0.1.2.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
+	install -m 644 ext/apache-mime4j-core-0.7.2.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
+	install -m 644 ext/apache-mime4j-dom-0.7.2.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
+	install -m 644 ext/apache-mime4j-storage-0.7.2.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
+	install -m 644 ext/istack-commons-runtime-2.4.jar ${DESTDIR}$(DATA_DIR)/engine.ear/lib/
 	# USB filter:
 	install -m 644 frontend/usbfilter.txt $(DESTDIR)$(PKG_SYSCONF_DIR)
 
diff --git a/backend/manager/conf/ca/encryptpasswd.sh b/backend/manager/conf/ca/encryptpasswd.sh
index 29db117..ece2cd6 100644
--- a/backend/manager/conf/ca/encryptpasswd.sh
+++ b/backend/manager/conf/ca/encryptpasswd.sh
@@ -26,6 +26,7 @@ if [[ "x${JAVA_HOME}" != "x" ]] ;then
     JAVA_BIN=$JAVA_HOME/bin/java
 fi
 
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
 
 pushd  $JBOSS_HOME
 #if [ -e "common/lib/jbosssx.jar" ]; then
@@ -37,7 +38,8 @@ pushd  $JBOSS_HOME
 #        exit 1
 #fi
 
-$JAVA_BIN -cp `build-classpath jboss-logging picketbox/picketbox` org.picketbox.datasource.security.SecureIdentityLoginModule "$1"
+#$JAVA_BIN -cp `build-classpath jboss-logging picketbox/picketbox` org.picketbox.datasource.security.SecureIdentityLoginModule "$1"
+$JAVA_BIN -cp $EAR_LIB/picketbox-4.0.7.Final.jar:$EAR_LIB/jboss-logging-3.1.0.GA.jar org.picketbox.datasource.security.SecureIdentityLoginModule $1
 
 popd
 
diff --git a/backend/manager/conf/kerberos/engine-manage-domains b/backend/manager/conf/kerberos/engine-manage-domains
index 0be51ab..7b067f9 100755
--- a/backend/manager/conf/kerberos/engine-manage-domains
+++ b/backend/manager/conf/kerberos/engine-manage-domains
@@ -90,27 +90,52 @@ if [ "$1" == "--help" -o "$1" == "-h" ]; then
         exit 0
 fi
 
+#CP=\
+#$CONF_DIR:`\
+#build-classpath \
+#apache-commons-codec \
+#apache-commons-collections \
+#apache-commons-configuration \
+#apache-commons-jxpath \
+#apache-commons-lang \
+#apache-commons-logging \
+#log4j \
+#ovirt-engine/common \
+#ovirt-engine/compat \
+#ovirt-engine/engineencryptutils \
+#ovirt-engine/engine-tools-common \
+#ovirt-engine/utils \
+#postgresql-jdbc \
+#springframework/spring-beans \
+#springframework/spring-core \
+#springframework/spring-tx \
+#spring-ldap/spring-ldap-core \
+#`
+
+ENGINE_LIB=/usr/share/java/ovirt-engine
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
+
 CP=\
-$CONF_DIR:`\
-build-classpath \
-apache-commons-codec \
-apache-commons-collections \
-apache-commons-configuration \
-apache-commons-jxpath \
-apache-commons-lang \
-apache-commons-logging \
-log4j \
-ovirt-engine/common \
-ovirt-engine/compat \
-ovirt-engine/engineencryptutils \
-ovirt-engine/engine-tools-common \
-ovirt-engine/utils \
-postgresql-jdbc \
-springframework/spring-beans \
-springframework/spring-core \
-springframework/spring-tx \
-spring-ldap/spring-ldap-core \
-`
+$CONF_DIR:\
+$EAR_LIB/commons-codec-1.4.jar:\
+$EAR_LIB/commons-collections-3.1.jar:\
+$EAR_LIB/commons-configuration-1.6.jar:\
+$EAR_LIB/commons-jxpath-1.3.jar:\
+$EAR_LIB/commons-lang-2.6.jar:\
+$EAR_LIB/commons-logging-1.0.4.jar:\
+$EAR_LIB/log4j-1.2.16.jar:\
+$EAR_LIB/postgresql-jdbc.jar:\
+$EAR_LIB/spring-beans-3.1.1.RELEASE.jar:\
+$EAR_LIB/spring-core-3.1.1.RELEASE.jar:\
+$EAR_LIB/spring-tx-3.1.1.RELEASE.jar:\
+$EAR_LIB/spring-ldap-core-1.3.1.RELEASE.jar:\
+$ENGINE_LIB/compat.jar:\
+$ENGINE_LIB/common.jar:\
+$ENGINE_LIB/engine-config.jar:\
+$ENGINE_LIB/engineencryptutils.jar:\
+$ENGINE_LIB/engine-tools-common.jar:\
+$ENGINE_LIB/utils.jar
+
 
 for f in $(echo $CP|sed 's/:/ /g')
 do
diff --git a/backend/manager/dbscripts/upgrade/03_01_1540_add_smartcard.sql b/backend/manager/dbscripts/upgrade/03_01_1540_add_smartcard.sql
new file mode 100644
index 0000000..3d0ed0d
--- /dev/null
+++ b/backend/manager/dbscripts/upgrade/03_01_1540_add_smartcard.sql
@@ -0,0 +1 @@
+select fn_db_add_column('vm_static', 'is_smartcard_enabled', 'BOOLEAN default false');
diff --git a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
index 438dc3c..75c853b 100644
--- a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -86,8 +86,10 @@ select fn_db_add_config_value('DocsURL','docs','general');
 --Handling NetBIOS Domain Name
 select fn_db_add_config_value('DomainName','example.com','general');
 select fn_db_add_config_value('EmulatedMachine','rhel6.0.0','3.0');
-select fn_db_add_config_value('EmulatedMachine','pc-0.14','3.1');
-select fn_db_add_config_value('EmulatedMachine','pc-0.14','3.2');
+--select fn_db_add_config_value('EmulatedMachine','pc-0.14','3.1');
+--select fn_db_add_config_value('EmulatedMachine','pc-0.14','3.2');
+select fn_db_add_config_value('EmulatedMachine','pc','3.1');
+select fn_db_add_config_value('EmulatedMachine','pc','3.2');
 -- Host time drift
 select fn_db_add_config_value('EnableHostTimeDrift','false','general');
 --Handling Enable Spice Root Certification Validation
@@ -564,7 +566,8 @@ select fn_db_update_default_config_value('AdUserPassword','example.com:SamplePas
 -- Increase AsyncTaskZombieTaskLifeInMinutes to 50 hours if it's the default 5 hours.
 select fn_db_update_default_config_value('AsyncTaskZombieTaskLifeInMinutes','300','3000','general',false);
 select fn_db_update_default_config_value('DomainName','example.com','','general',false);
-select fn_db_update_default_config_value('EmulatedMachine','rhel6.0.0', 'pc-0.14','3.0',false);
+--select fn_db_update_default_config_value('EmulatedMachine','rhel6.0.0', 'pc-0.14','3.0',false);
+select fn_db_update_default_config_value('EmulatedMachine','rhel6.0.0', 'pc','3.0',false);
 select fn_db_update_default_config_value('LDAPSecurityAuthentication','GSSAPI','default:GSSAPI','general',false);
 select fn_db_update_default_config_value('LDAPSecurityAuthentication','SIMPLE','default:SIMPLE','general',false);
 select fn_db_update_default_config_value('VdsLocalDisksCriticallyLowFreeSpace','100','500','general',false);
diff --git a/backend/manager/dbscripts/upgrade/pre_upgrade/0040_materialized_views_extensions.sql b/backend/manager/dbscripts/upgrade/pre_upgrade/0040_materialized_views_extensions.sql
new file mode 100644
index 0000000..a3d2260
--- /dev/null
+++ b/backend/manager/dbscripts/upgrade/pre_upgrade/0040_materialized_views_extensions.sql
@@ -0,0 +1,6 @@
+-- Determines the minimum duration we will have to wait between 2 refreshes , 0 means : no wait
+select fn_db_add_column('materialized_views', 'min_refresh_rate_in_sec', 'int default 0');
+-- Indicates if this is a product view or custom view
+select fn_db_add_column('materialized_views', 'custom', 'boolean default false');
+-- Indicates if this materialized_view is currently active
+select fn_db_add_column('materialized_views', 'active', 'boolean default true');
diff --git a/backend/manager/tools/engine-config/src/main/resources/engine-config b/backend/manager/tools/engine-config/src/main/resources/engine-config
index 857e75d..c4fc6e0 100755
--- a/backend/manager/tools/engine-config/src/main/resources/engine-config
+++ b/backend/manager/tools/engine-config/src/main/resources/engine-config
@@ -89,21 +89,38 @@ if [ "$1" == "--help" -o "$1" == "-h" ]; then
         exit 0
 fi
 
-CP=`\
-build-classpath \
-apache-commons-codec \
-apache-commons-collections \
-apache-commons-configuration \
-apache-commons-jxpath \
-apache-commons-lang \
-apache-commons-logging \
-log4j \
-ovirt-engine/compat \
-ovirt-engine/engine-config \
-ovirt-engine/engineencryptutils \
-ovirt-engine/engine-tools-common \
-postgresql-jdbc \
-`
+#CP=`\
+#build-classpath \
+#apache-commons-codec \
+#apache-commons-collections \
+#apache-commons-configuration \
+#apache-commons-jxpath \
+#apache-commons-lang \
+#apache-commons-logging \
+#log4j \
+#ovirt-engine/compat \
+#ovirt-engine/engine-config \
+#ovirt-engine/engineencryptutils \
+#ovirt-engine/engine-tools-common \
+#postgresql-jdbc \
+#`
+
+ENGINE_LIB=/usr/share/java/ovirt-engine
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
+
+CP=\
+$EAR_LIB/commons-codec-1.4.jar:\
+$EAR_LIB/commons-collections-3.1.jar:\
+$EAR_LIB/commons-configuration-1.6.jar:\
+$EAR_LIB/commons-jxpath-1.3.jar:\
+$EAR_LIB/commons-lang-2.6.jar:\
+$EAR_LIB/commons-logging-1.0.4.jar:\
+$EAR_LIB/log4j-1.2.16.jar:\
+$EAR_LIB/postgresql-jdbc.jar:\
+$ENGINE_LIB/compat.jar:\
+$ENGINE_LIB/engine-config.jar:\
+$ENGINE_LIB/engineencryptutils.jar:\
+$ENGINE_LIB/engine-tools-common.jar
 
 # Verify all classpath elements available
 for f in $(echo $CP|sed 's/:/ /g')
diff --git a/ext/apache-mime4j-core-0.7.2.jar b/ext/apache-mime4j-core-0.7.2.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b5c225b5dbd496889342baf249c332f0944f7eee
GIT binary patch
diff --git a/ext/apache-mime4j-dom-0.7.2.jar b/ext/apache-mime4j-dom-0.7.2.jar
new file mode 100644
index 0000000000000000000000000000000000000000..0cdd3ce33c0aecd2daf86cd613e045f90a3cbb30
GIT binary patch
diff --git a/ext/apache-mime4j-storage-0.7.2.jar b/ext/apache-mime4j-storage-0.7.2.jar
new file mode 100644
index 0000000000000000000000000000000000000000..ee86b9ca09b8757cb79bd660043d22de2928717d
GIT binary patch
diff --git a/ext/commons-jxpath-1.3.jar b/ext/commons-jxpath-1.3.jar
new file mode 100644
index 0000000000000000000000000000000000000000..e344a1e66d83ce608928a1e5e01dacfbc6270ab0
GIT binary patch
diff --git a/ext/commons-logging-1.0.4.jar b/ext/commons-logging-1.0.4.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b73a80fab641131e6fbe3ae833549efb3c540d17
GIT binary patch
diff --git a/ext/istack-commons-runtime-2.4.jar b/ext/istack-commons-runtime-2.4.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b0a99a8b7667e0dfce5c56bdf00b90a83d0546ab
GIT binary patch
diff --git a/ext/jtype-0.1.2.jar b/ext/jtype-0.1.2.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b0d40ab8d002dd5adafac890dd96430ff1fca770
GIT binary patch
diff --git a/packaging/fedora/engine-service.systemv b/packaging/fedora/engine-service.systemv
new file mode 100644
index 0000000..592cb48
--- /dev/null
+++ b/packaging/fedora/engine-service.systemv
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# Start/stop oVirt Engine
+#
+# chkconfig: - 65 34
+# description: oVirt Engine
+# pidfile: /var/run/ovirt-engine.pid
+
+# Load the sysconfig file into the environment:
+if [ -f /etc/sysconfig/ovirt-engine ]
+then
+  . /etc/sysconfig/ovirt-engine
+fi
+
+# Export the variables potentially used in the sysconfig
+# configuration file:
+export ENGINE_USER
+export ENGINE_GROUP
+export ENGINE_MIN_HEAP
+export ENGINE_MAX_HEAP
+export ENGINE_DEBUG_ADDRESS
+export ENGINE_VERBOSE_GC
+
+# The service script takes care of the rest:
+#exec /usr/share/ovirt-engine/service/engine-service.py $*
+exec /usr/bin/engine-service $*
diff --git a/packaging/fedora/setup/basedefs.py b/packaging/fedora/setup/basedefs.py
index fc4cd67..5eb3ca0 100644
--- a/packaging/fedora/setup/basedefs.py
+++ b/packaging/fedora/setup/basedefs.py
@@ -19,7 +19,7 @@ ENGINE_USER_NAME="ovirt"
 ENGINE_GROUP_NAME="ovirt"
 HTTPD_SERVICE_NAME="httpd"
 HTTP_PORT_POLICY="http_port_t"
-NFS_SERVICE_NAME="nfs-server"
+NFS_SERVICE_NAME="nfs"
 NOTIFIER_SERVICE_NAME = "engine-notifierd"
 ETL_SERVICE_NAME = "ovirt-engine-dwhd"
 FREEIPA_RPM = "freeipa-server"
diff --git a/packaging/fedora/setup/common_utils.py b/packaging/fedora/setup/common_utils.py
index 05eb0c2..7abf82e 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -1282,13 +1282,16 @@ class Service():
         logging.debug("checking if %s service is available", self.name)
 
         # Checks if systemd service available
-        cmd = [
-            basedefs.EXEC_SYSTEMCTL,
-            "show",
-            self.name
-        ]
-        out, rc = execCmd(cmdList=cmd)
-        sysd = "LoadState=loaded" in out
+        if os.path.isfile(basedefs.EXEC_SYSTEMCTL):
+            cmd = [
+                basedefs.EXEC_SYSTEMCTL,
+                "show",
+                self.name
+            ]
+            out, rc = execCmd(cmdList=cmd)
+            sysd = "LoadState=loaded" in out
+        else:
+            sysd = None
 
         # Checks if systemV service available
         sysv = os.path.exists("/etc/init.d/%s" % self.name)
diff --git a/packaging/fedora/spec/ovirt-engine.spec.in b/packaging/fedora/spec/ovirt-engine.spec.in
index 922a045..43449d9 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -99,43 +99,43 @@ Source0: http://ovirt.org/releases/stable/src/%{name}-%{version}.tar.gz
 BuildArch: noarch
 
 # Build time requirements:
-BuildRequires: apache-commons-beanutils
-BuildRequires: apache-commons-codec
-BuildRequires: apache-commons-collections
-BuildRequires: apache-commons-configuration
-BuildRequires: apache-commons-jxpath
-BuildRequires: apache-commons-lang
-BuildRequires: apache-commons-logging
-BuildRequires: apache-commons-compress
-BuildRequires: apache-mina
-BuildRequires: apache-sshd
+#BuildRequires: apache-commons-beanutils
+#BuildRequires: apache-commons-codec
+#BuildRequires: apache-commons-collections
+#BuildRequires: apache-commons-configuration
+#BuildRequires: apache-commons-jxpath
+#BuildRequires: apache-commons-lang
+#BuildRequires: apache-commons-logging
+#BuildRequires: apache-commons-compress
+#BuildRequires: apache-mina
+#BuildRequires: apache-sshd
 BuildRequires: bea-stax-api
 BuildRequires: dos2unix
-BuildRequires: jackson
-BuildRequires: hibernate-commons-annotations
-BuildRequires: hibernate-jpa-2.0-api
-BuildRequires: hibernate-validator
-BuildRequires: jakarta-commons-httpclient
+#BuildRequires: jackson
+#BuildRequires: hibernate-commons-annotations
+#BuildRequires: hibernate-jpa-2.0-api
+#BuildRequires: hibernate-validator
+#BuildRequires: jakarta-commons-httpclient
 BuildRequires: java-devel
 BuildRequires: javamail
 BuildRequires: javassist
-BuildRequires: jboss-annotations-1.1-api
-BuildRequires: jboss-ejb-3.1-api
-BuildRequires: jboss-logging
-BuildRequires: jboss-interceptors-1.1-api
-BuildRequires: jboss-servlet-3.0-api
-BuildRequires: jpackage-utils
-BuildRequires: jsch
-BuildRequires: log4j
+#BuildRequires: jboss-annotations-1.1-api
+#BuildRequires: jboss-ejb-3.1-api
+#BuildRequires: jboss-logging
+#BuildRequires: jboss-interceptors-1.1-api
+#BuildRequires: jboss-servlet-3.0-api
+#BuildRequires: jpackage-utils
+#BuildRequires: jsch
+#BuildRequires: log4j
 BuildRequires: make
-BuildRequires: maven
+#BuildRequires: maven
 BuildRequires: postgresql-jdbc
-BuildRequires: quartz
-BuildRequires: resteasy
-BuildRequires: springframework-instrument
-BuildRequires: springframework-jdbc
-BuildRequires: spring-ldap
-BuildRequires: xmlrpc3-client
+#BuildRequires: quartz
+#BuildRequires: resteasy
+#BuildRequires: springframework-instrument
+#BuildRequires: springframework-jdbc
+#BuildRequires: spring-ldap
+#BuildRequires: xmlrpc3-client
 BuildRequires: unzip
 BuildRequires: ovirt-host-deploy-java
 
@@ -144,17 +144,18 @@ BuildRequires: ovirt-host-deploy-java
 Requires: bea-stax-api
 Requires: bind-utils
 Requires: cracklib-python
-Requires: geronimo-validation
-Requires: hibernate-commons-annotations
-Requires: hibernate-jpa-2.0-api
-Requires: hibernate-validator
+#Requires: geronimo-validation
+#Requires: hibernate-commons-annotations
+#Requires: hibernate-jpa-2.0-api
+#Requires: hibernate-validator
 Requires: httpd
+Requires: apr
 Requires: java-1.7.0-openjdk >= 1:1.7.0.9-2.3.3.2
-Requires: jakarta-commons-httpclient
+#Requires: jakarta-commons-httpclient
 Requires: java
-Requires: jboss-interceptors-1.1-api
-Requires: jboss-logging
-Requires: jpackage-utils
+#Requires: jboss-interceptors-1.1-api
+#Requires: jboss-logging
+#Requires: jpackage-utils
 Requires: log4j
 Requires: mod_ssl
 Requires: ntp
@@ -169,9 +170,13 @@ Requires: ovirt-engine-cli
 
 # For local database:
 Requires: postgresql-server >= 8.4.7
+Requires: postgresql-contrib
 
 # Require JBoss AS 7:
-Requires: jboss-as >= 7.1.1-9.3
+#Requires: jboss-as >= 7.1.1-9.3
+#Replacing with JbossAS 7.1.1 binary rpm
+Requires: ovirt-engine-jbossas711
+
 
 # We can't require exactly the same version and release of the
 # setup package because it needs to be updated independely as part
@@ -205,39 +210,39 @@ virtualization infrastructure for Servers and Desktops.
 Summary: Engine core of %{product_name_short}
 Group: Virtualization/Management
 Requires: %{name} = %{version}-%{release}
-Requires: apache-commons-beanutils
-Requires: apache-commons-codec
-Requires: apache-commons-collections
-Requires: apache-commons-lang
-Requires: apache-commons-compress
-Requires: apache-mina
-Requires: apache-sshd
+#Requires: apache-commons-beanutils
+#Requires: apache-commons-codec
+#Requires: apache-commons-collections
+#Requires: apache-commons-lang
+#Requires: apache-commons-compress
+#Requires: apache-mina
+#Requires: apache-sshd
 Requires: bea-stax-api
-Requires: dom4j
-Requires: geronimo-validation
-Requires: jackson
-Requires: jakarta-commons-httpclient
+#Requires: dom4j
+#Requires: geronimo-validation
+#Requires: jackson
+#Requires: jakarta-commons-httpclient
 Requires: java
 Requires: javassist
-Requires: jboss-interceptors-1.1-api
-Requires: jsch
+#Requires: jboss-interceptors-1.1-api
+#Requires: jsch
 Requires: objectweb-asm
 Requires: openssh
 Requires: openssl
-Requires: picketbox
-Requires: quartz
-Requires: slf4j
-Requires: springframework
-Requires: springframework-aop
-Requires: springframework-beans
-Requires: springframework-context
-Requires: springframework-instrument
-Requires: springframework-jdbc
-Requires: springframework-tx
-Requires: spring-ldap
-Requires: ws-commons-util
-Requires: xmlrpc3-client
-Requires: xmlrpc3-common
+#Requires: picketbox
+#Requires: quartz
+#Requires: slf4j
+#Requires: springframework
+#Requires: springframework-aop
+#Requires: springframework-beans
+#Requires: springframework-context
+#Requires: springframework-instrument
+#Requires: springframework-jdbc
+#Requires: springframework-tx
+#Requires: spring-ldap
+#Requires: ws-commons-util
+#Requires: xmlrpc3-client
+#Requires: xmlrpc3-common
 
 
 %description backend
@@ -306,13 +311,13 @@ The web administration interface to %{product_name_short}
 Summary: Common libraries for  %{product_name_short} Tools
 Group: Virtualization/Management
 Requires: %{name} = %{version}-%{release}
-Requires: apache-commons-collections
-Requires: apache-commons-logging
-Requires: apache-commons-lang
-Requires: apache-commons-codec
-Requires: apache-commons-configuration
-Requires: apache-commons-jxpath
-Requires: log4j
+#Requires: apache-commons-collections
+#Requires: apache-commons-logging
+#Requires: apache-commons-lang
+#Requires: apache-commons-codec
+#Requires: apache-commons-configuration
+#Requires: apache-commons-jxpath
+#Requires: log4j
 
 %description tools-common
 The common libraries used by %{product_name_short} Tools
@@ -409,95 +414,95 @@ done
 %endif
 
 # Remove the jar files that are not needed:
-while read lib_path
-do
-  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
-done <<'.'
-activation
-antlr
-aopalliance
-c3p0
-ejb3-persistence
-jaxb-api
-jaxb-impl
-jboss-interceptors-api_1.1_spec
-stax-api
-xml-apis
-.
+#while read lib_path
+#do
+#  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
+#done <<'.'
+#activation
+#antlr
+#aopalliance
+#c3p0
+#ejb3-persistence
+#jaxb-api
+#jaxb-impl
+#jboss-interceptors-api_1.1_spec
+#stax-api
+#xml-apis
+#.
 
 # Attention!
 # spring-asm *IS* required on rhel-6
-rm -rf %{buildroot}%{engine_ear}/lib/spring-asm*.jar
+#rm -rf %{buildroot}%{engine_ear}/lib/spring-asm*.jar
 
 # Then for the system jar files (using build-classpath):
-while read jar_name lib_path
-do
-  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
-  ln -s `build-classpath ${jar_name}` %{buildroot}%{engine_ear}/lib/${lib_path}.jar
-done <<'.'
-apache-mina/mina-core mina-core
-apache-sshd/sshd-core sshd-core
-commons-beanutils commons-beanutils
-commons-codec commons-codec
-commons-collections commons-collections
-commons-httpclient commons-httpclient
-commons-lang commons-lang
-commons-compress commons-compress
-dom4j dom4j
-geronimo-validation validation-api
-hibernate/hibernate-commons-annotations hibernate-commons-annotations
-hibernate-validator hibernate-validator
-jsch jsch
-objectweb-asm/asm-all asm-all
-quartz quartz
-slf4j/api slf4j-api
-springframework/spring-aop spring-aop
-springframework/spring-beans spring-beans
-springframework/spring-context spring-context
-springframework/spring-core spring-core
-springframework/spring-expression spring-expression
-springframework/spring-instrument spring-instrument
-springframework/spring-jdbc spring-jdbc
-springframework/spring-tx spring-tx
-spring-ldap/spring-ldap-core spring-ldap-core
-ws-commons-util ws-commons-util
-xmlrpc3-client xmlrpc-client
-xmlrpc3-common xmlrpc-common
-otopi/otopi otopi
-ovirt-host-deploy/ovirt-host-deploy ovirt-host-deploy
-.
+#while read jar_name lib_path
+#do
+#  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
+#  ln -s `build-classpath ${jar_name}` %{buildroot}%{engine_ear}/lib/${lib_path}.jar
+#done <<'.'
+#apache-mina/mina-core mina-core
+#apache-sshd/sshd-core sshd-core
+#commons-beanutils commons-beanutils
+#commons-codec commons-codec
+#commons-collections commons-collections
+#commons-httpclient commons-httpclient
+#commons-lang commons-lang
+#commons-compress commons-compress
+#dom4j dom4j
+#geronimo-validation validation-api
+#hibernate/hibernate-commons-annotations hibernate-commons-annotations
+#hibernate-validator hibernate-validator
+#jsch jsch
+#objectweb-asm/asm-all asm-all
+#quartz quartz
+#slf4j/api slf4j-api
+#springframework/spring-aop spring-aop
+#springframework/spring-beans spring-beans
+#springframework/spring-context spring-context
+#springframework/spring-core spring-core
+#springframework/spring-expression spring-expression
+#springframework/spring-instrument spring-instrument
+#springframework/spring-jdbc spring-jdbc
+#springframework/spring-tx spring-tx
+#spring-ldap/spring-ldap-core spring-ldap-core
+#ws-commons-util ws-commons-util
+#xmlrpc3-client xmlrpc-client
+#xmlrpc3-common xmlrpc-common
+#otopi/otopi otopi
+#ovirt-host-deploy/ovirt-host-deploy ovirt-host-deploy
+#.
 
 # Replace jar files in the RESTAPI web application with links to ther
 # actual locations, first for jar files from this package, as for these
 # can't use build-classpath:
-while read jar_name lib_path
-do
-  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
-  ln -s %{engine_java}/${jar_name}.jar %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
-done <<'.'
-interface-common-jaxrs interface-common-jaxrs
-restapi-definition restapi-definition
-restapi-jaxrs restapi-jaxrs
-restapi-types restapi-types
-.
+#while read jar_name lib_path
+#do
+#  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
+#  ln -s %{engine_java}/${jar_name}.jar %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
+#done <<'.'
+#interface-common-jaxrs interface-common-jaxrs
+#restapi-definition restapi-definition
+#restapi-jaxrs restapi-jaxrs
+#restapi-types restapi-types
+#.
 
 # Remove the jar files that are not needed:
-while read lib_path
-do
-  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
-done <<'.'
-commons-codec
-log4j
-.
+#while read lib_path
+#do
+#  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
+#done <<'.'
+#commons-codec
+#log4j
+#.
 
 # Then for the system jar files (using build-classpath):
-while read jar_name lib_path
-do
-  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
-  ln -s `build-classpath ${jar_name}` %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
-done <<'.'
-snakeyaml snakeyaml
-.
+#while read jar_name lib_path
+#do
+#  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
+#  ln -s `build-classpath ${jar_name}` %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
+#done <<'.'
+#snakeyaml snakeyaml
+#.
 
 # Copy the module definitions:
 install -dm 755 %{buildroot}%{engine_jboss_modules}
@@ -506,8 +511,9 @@ find %{buildroot}%{engine_jboss_modules} -type d -exec chmod 755 {} \;
 find %{buildroot}%{engine_jboss_modules} -type f -exec chmod 644 {} \;
 
 # Install the systemd files:
-install -dm 755 %{buildroot}%{_unitdir}
-install -m 644 packaging/fedora/engine-service.systemd %{buildroot}%{_unitdir}/%{engine_name}.service
+#install -dm 755 %{buildroot}%{_unitdir}
+#install -m 644 packaging/fedora/engine-service.systemd %{buildroot}%{_unitdir}/%{engine_name}.service
+install -m 755 packaging/fedora/engine-service.systemv %{buildroot}%{_initrddir}/%{engine_name}
 install -dm 755 %{buildroot}%{_sysconfdir}/tmpfiles.d
 install -m 644 packaging/resources/ovirt-tmpfilesd %{buildroot}%{_sysconfdir}/tmpfiles.d/ovirt-engine.conf
 
@@ -552,6 +558,92 @@ fi
 %pre setup
 %create_vdsm_user
 
+%post
+#Add link to engine_pki from engine config dir
+ln -f -s %{engine_pki} %{_sysconfdir}/%{engine_name}/ca
+
+#Add jars to ear from JbossAs
+ln -f -s  /usr/share/jboss-as/modules/org/apache/commons/configuration/main/commons-configuration-1.6.jar %{engine_ear}/lib/commons-configuration-1.6.jar
+ln -f -s  /usr/share/jboss-as/modules/org/apache/log4j/main/log4j-1.2.16.jar %{engine_ear}/lib/log4j-1.2.16.jar
+ln -f -s  /usr/share/jboss-as/modules/org/jboss/logging/main/jboss-logging-3.1.0.GA.jar %{engine_ear}/lib/jboss-logging-3.1.0.GA.jar
+ln -f -s  /usr/share/jboss-as/modules/org/picketbox/main/picketbox-4.0.7.Final.jar %{engine_ear}/lib/picketbox-4.0.7.Final.jar
+ln -f -s  /usr/share/java/postgresql-jdbc.jar %{engine_ear}/lib/postgresql-jdbc.jar
+
+#Make links in ovirt-engine modules
+mkdir -p %{engine_jboss_modules}/com/sun/xml/bind/main
+ln -f -s %{engine_ear}/lib/jaxb-impl-2.1.3.jar %{engine_data}/modules/com/sun/xml/bind/main/jaxb-impl.jar
+ln -f -s /usr/share/jboss-as/modules/com/sun/xml/bind/main/jaxb-xjc-2.2.4.jar %{engine_data}/modules/com/sun/xml/bind/main/jaxb-xjc.jar
+ln -f -s %{engine_ear}/lib/istack-commons-runtime-2.4.jar %{engine_jboss_modules}/com/sun/xml/bind/main/istack-commons-runtime.jar
+
+mkdir -p %{engine_data}/modules/javax/ws/rs/api/main
+ln -f -s /usr/share/jboss-as/modules/javax/ws/rs/api/main/jboss-jaxrs-api_1.1_spec-1.0.0.Final.jar %{engine_data}/modules/javax/ws/rs/api/main/jaxrs-api.jar
+
+mkdir -p %{engine_data}/modules/org/apache/commons/codec/main
+ln -f -s /usr/share/jboss-as/modules/org/apache/commons/codec/main/commons-codec-1.4.jar %{engine_data}/modules/org/apache/commons/codec/main/commons-codec.jar
+
+#!!mkdir %{engine_data}/modules/org/apache/httpcomponents/main
+#!!ln -f -s /usr/share/jboss-as/modules/org/apache/httpcomponents/main/httpclient-4.1.2.jar %{engine_data}/modules/org/apache/httpcomponents/main/httpclient.jar
+#!!ln -f -s /usr/share/jboss-as/modules/org/apache/httpcomponents/main/httpcore-4.1.4.jar %{engine_data}/modules/org/apache/httpcomponents/main/httpcore.jar
+#!!ln -f -s /usr/share/jboss-as/modules/org/apache/httpcomponents/main/httpmime-4.1.2.jar %{engine_data}/modules/org/apache/httpcomponents/main/httpmime.jar
+
+#!!mkdir %{engine_data}/modules/org/codehaus/jackson/jackson-core-asl/main
+#!!ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-core-asl/main/jackson-core-asl-1.9.2.jar %{engine_data}/modules/org/codehaus/jackson/jackson-core-asl/main/jackson-core-asl.jar
+
+#!!mkdir %{engine_data}/modules/org/codehaus/jackson/jackson-jaxrs/main
+#!!ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-jaxrs/main/jackson-jaxrs-1.9.2.jar %{engine_data}/modules/org/codehaus/jackson/jackson-jaxrs/main/jackson-jaxrs.jar
+
+mkdir -p %{engine_data}/modules/org/codehaus/jackson/jackson-mapper-asl/main
+ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-mapper-asl/main/jackson-mapper-asl-1.9.2.jar %{engine_data}/modules/org/codehaus/jackson/jackson-mapper-asl/main/jackson-mapper-asl.jar
+
+#!!mkdir %{engine_data}/modules/org/codehaus/jackson/jackson-xc/main
+#!!ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-xc/main/jackson-xc-1.9.2.jar %{engine_data}/modules/org/codehaus/jackson/jackson-xc/main/jackson-xc.jar
+mkdir -p %{engine_data}/modules/org/hibernate/validator/main
+ln -f -s /usr/share/jboss-as/modules/org/hibernate/validator/main/hibernate-validator-4.2.0.Final.jar %{engine_data}/modules/org/hibernate/validator/main/hibernate-validator.jar
+
+mkdir -p %{engine_data}/modules/org/hibernate/validator/main
+ln -f -s %{engine_ear}/lib/jtype-0.1.2.jar %{engine_data}/modules/org/hibernate/validator/main/jtype.jar
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-atom-provider/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-atom-provider/main/resteasy-atom-provider-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-atom-provider/main/resteasy-atom-provider.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-cdi/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-cdi/main/resteasy-cdi-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-cdi/main/resteasy-cdi.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-jackson-provider/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jackson-provider/main/resteasy-jackson-provider-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-jackson-provider/main/resteasy-jackson-provider.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-jaxb-provider/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jaxb-provider/main/resteasy-jaxb-provider-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-jaxb-provider/main/resteasy-jaxb-provider.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-jaxrs/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jaxrs/main/async-http-servlet-3.0-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-jaxrs/main/async-http-servlet-3.0.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-jaxrs/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jaxrs/main/resteasy-jaxrs-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-jaxrs/main/resteasy-jaxrs.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-jettison-provider/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jettison-provider/main/resteasy-jettison-provider-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-jettison-provider/main/resteasy-jettison-provider.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-jsapi/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jsapi/main/resteasy-jsapi-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-jsapi/main/resteasy-jsapi.jar
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-multipart-provider/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-multipart-provider/main/resteasy-multipart-provider-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-multipart-provider/main/resteasy-multipart-provider.jar
+
+mkdir -p %{engine_data}/modules/org/jboss/resteasy/resteasy-yaml-provider/main
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-yaml-provider/main/resteasy-yaml-provider-2.3.2.Final.jar %{engine_data}/modules/org/jboss/resteasy/resteasy-yaml-provider/main/resteasy-yaml-provider.jar
+
+mkdir -p %{engine_data}/modules/org/scannotation/scannotation/main
+ln -f -s /usr/share/jboss-as/modules/org/scannotation/scannotation/main/scannotation-1.0.2.jar %{engine_data}/modules/org/scannotation/scannotation/main/scannotation.jar
+
+mkdir -p %{engine_jboss_modules}/org/apache/james/mime4j/main
+ln -f -s %{engine_ear}/lib/apache-mime4j-core-0.7.2.jar %{engine_jboss_modules}/org/apache/james/mime4j/main/core.jar
+ln -f -s %{engine_ear}/lib/apache-mime4j-dom-0.7.2.jar %{engine_jboss_modules}/org/apache/james/mime4j/main/dom.jar
+ln -f -s %{engine_ear}/lib/apache-mime4j-storage-0.7.2.jar %{engine_jboss_modules}/org/apache/james/mime4j/main/storage.jar
+
+mkdir -p  %{engine_jboss_modules}/org/yaml/snakeyaml/main
+ln -f -s /usr/share/jboss-as/modules/org/yaml/snakeyaml/main/snakeyaml-1.8.jar  %{engine_jboss_modules}/org/yaml/snakeyaml/main/snakeyaml.jar
+
+mkdir -p %{engine_jboss_modules}/org/codehaus/jettison/main
+ln -f -s /usr/share/jboss-as-7.1.1.Final/modules/org/codehaus/jettison/main/jettison-1.3.1.jar %{engine_jboss_modules}/org/codehaus/jettison/main/jettison.jar
 
 %files
 
@@ -582,7 +674,8 @@ fi
 %dir %{_sysconfdir}/sysconfig/%{engine_name}.d
 %{engine_data}/service
 %{_bindir}/engine-service
-%{_unitdir}/%{engine_name}.service
+#%{_unitdir}/%{engine_name}.service
+%{_initrddir}/%{engine_name}
 
 # Jar files used by all the components:
 %dir %{engine_java}
@@ -604,6 +697,15 @@ fi
 %{_mavenpomdir}/JPP.%{name}-utils.pom
 %endif
 
+# Additional jars
+%{engine_ear}/lib/commons-jxpath-1.3.jar
+%{engine_ear}/lib/commons-logging-1.0.4.jar
+%{engine_ear}/lib/jtype-0.1.2.jar
+%{engine_ear}/lib/apache-mime4j-core-0.7.2.jar
+%{engine_ear}/lib/apache-mime4j-dom-0.7.2.jar
+%{engine_ear}/lib/apache-mime4j-storage-0.7.2.jar
+%{engine_ear}/lib/istack-commons-runtime-2.4.jar
+
 # Documentation:
 %doc LICENSE
 
diff --git a/pom.xml b/pom.xml
index d4170d2..63580d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -366,6 +366,7 @@
               <include>**/*.java</include>
               <include>**/*.properties</include>
             </includes>
+            <encoding>UTF-8</encoding>
           </configuration>
         </plugin>
         <plugin>
-- 
1.7.1


From 097a5e3b3e26dbe55f852ae34115b76025d6fc83 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Tue, 19 Feb 2013 17:09:06 +0400
Subject: [PATCH 02/13] Add Idf596fa9

---
 packaging/fedora/setup/basedefs.py       |    3 +
 packaging/fedora/setup/common_utils.py   |  100 ++++++++++++++++++++++++++++++
 packaging/fedora/setup/engine-setup.py   |   16 +-----
 packaging/fedora/setup/engine-upgrade.py |    9 +++
 4 files changed, 113 insertions(+), 15 deletions(-)

diff --git a/packaging/fedora/setup/basedefs.py b/packaging/fedora/setup/basedefs.py
index 5eb3ca0..8293357 100644
--- a/packaging/fedora/setup/basedefs.py
+++ b/packaging/fedora/setup/basedefs.py
@@ -103,6 +103,9 @@ FILE_OVIRT_HTTPD_CONF="/etc/httpd/conf.d/ovirt-engine.conf"
 FILE_HTTPD_SSL_CONFIG="/etc/httpd/conf.d/ssl.conf"
 FILE_HTTPD_CONF="/etc/httpd/conf/httpd.conf"
 FILE_IMAGE_UPLOADER_CONF="/etc/ovirt-engine/imageuploader.conf"
+FILE_ENGINE_VERSION = "%s/version" % DIR_CONFIG
+FILE_WEB_CONF = "/etc/ovirt-engine/web-conf.js"
+OLD_ENGINE_SERVICE_XML = "/etc/ovirt-engine/engine-service.xml"
 
 # File containing the local configuration of the engine:
 FILE_ENGINE_SYSCONFIG="/etc/sysconfig/ovirt-engine"
diff --git a/packaging/fedora/setup/common_utils.py b/packaging/fedora/setup/common_utils.py
index 7abf82e..5b3ab47 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -22,6 +22,7 @@ import csv
 import miniyum
 import string
 import random
+from Cheetah.Template import Template
 
 # Create a special Exception class, so that it could be caught.
 class RetryFailException(Exception):
@@ -1599,3 +1600,102 @@ def isApplicationModeGluster(conf):
         return True
 
     return False
+
+def getEngineVersion():
+    # Just read the info from the file
+    with open(basedefs.FILE_ENGINE_VERSION) as version:
+        return version.readline().rstrip('\n')
+
+def redirectUrl():
+    try:
+        # Create the Apache configuration fragment from the template:
+        confTemplate = Template(file=basedefs.FILE_OVIRT_HTTPD_CONF_TEMPLATE)
+        confText = str(confTemplate)
+
+        # Save the text produced by the template:
+        fd = open(basedefs.FILE_OVIRT_HTTPD_CONF, 'w')
+        fd.write(confText)
+        fd.close()
+    except:
+        logging.error(traceback.format_exc())
+        raise Exception(output_messages.ERR_CREATE_OVIRT_HTTPD_CONF%(basedefs.FILE_OVIRT_HTTPD_CONF))
+
+def updateEngineSysconfig():
+    '''
+    Configure ovirt-engine post upgrade
+    '''
+    # Get DB Pass
+    dbPassword = getDbPassword(basedefs.DB_USER)
+
+    # Set DB Url
+    dbUrl = "jdbc:postgresql://%s:%s/%s" % (
+        getDbHostName(),
+        getDbPort(),
+        basedefs.DB_NAME,
+    )
+
+    # Update DB url with secured connection
+    if os.path.exists(basedefs.OLD_ENGINE_SERVICE_XML):
+        xmlObj = XMLConfigFileHandler(basedefs.OLD_ENGINE_SERVICE_XML)
+        xmlObj.open()
+        xmlObj.registerNs(
+            'datasource',
+            xmlObj.getNs('urn:jboss:domain:datasources'),
+        )
+        xpath = xmlObj.xpathEval(
+            "//datasource:subsystem/datasource:datasources/"
+            "datasource:datasource[@jndi-name='java:/ENGINEDataSource']/"
+            "connnection-property[@name='ssl']"
+        )
+
+        if xpath and xpath[0]:
+            # Means ssl mode was set
+            dbUrl = dbUrl + "?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory"
+
+    # Get current configuration
+
+    webConfigFile = basedefs.FILE_WEB_CONF
+
+    if not os.path.exists(basedefs.FILE_WEB_CONF):
+        if not os.path.exists(basedefs.FILE_WEB_CONF+".rpmsave"):
+            raise Exception("Can't find web config file")
+        else:
+            webConfigFile = basedefs.FILE_WEB_CONF+".rpmsave"
+
+    fqdn, httpPort, httpsPort = getHostParams(webConfigFile)
+
+    # Get encrypted password
+    masked_value_set = [dbPassword]
+    encryptedPassword = encryptEngineDBPass(password=dbPassword,
+                                            maskList=masked_value_set)
+
+    proxyEnabled = False
+    # If proxy already enabled, update the value
+    # of the proxyEnabled to True
+    if os.path.exists(basedefs.FILE_OVIRT_HTTPD_CONF):
+        proxyEnabled = True
+        backup_file = "%s.%s_%s" % (
+            basedefs.FILE_OVIRT_HTTPD_CONF,
+            time.strftime("%H%M%S-%m%d%Y"),
+            os.getpid(),
+        )
+        shutil.move(basedefs.FILE_OVIRT_HTTPD_CONF, backup_file)
+
+    # Regenerate the ovirt-engine.conf for httpd from the template
+    redirectUrl()
+
+    # Edit sysconfig file
+    editEngineSysconfig(
+        proxyEnabled=proxyEnabled,
+        dbUrl=dbUrl,
+        dbUser=getDbUser(),
+        fqdn=fqdn,
+        http=httpPort,
+        https=httpsPort,
+        javaHome=findJavaHome(),
+    )
+
+    # Set encrypted password
+    configEncryptedPass(encryptedPassword)
+
+    logging.debug("ovirt-engine configuration was successfully updated")
diff --git a/packaging/fedora/setup/engine-setup.py b/packaging/fedora/setup/engine-setup.py
index 29af270..70474ff 100755
--- a/packaging/fedora/setup/engine-setup.py
+++ b/packaging/fedora/setup/engine-setup.py
@@ -172,7 +172,7 @@ def initSequences():
                         'condition'       : [utils.compareStrIgnoreCase, controller.CONF["OVERRIDE_HTTPD_CONFIG"], "yes"],
                         'condition_match' : [True],
                         'steps'           : [ { 'title'     : output_messages.INFO_CONFIG_HTTPD,
-                                                'functions' : [_configureSelinuxBoolean, _backupOldHttpdConfig, _configureHttpdSslKeys, _configureHttpdPort, _configureHttpdSslPort, _redirectUrl, _startHttpd]}]
+                                                'functions' : [_configureSelinuxBoolean, _backupOldHttpdConfig, _configureHttpdSslKeys, _configureHttpdPort, _configureHttpdSslPort, utils.redirectUrl, _startHttpd]}]
                        },
                      ]
 
@@ -743,20 +743,6 @@ def _configureHttpdSslKeys():
         logging.error(traceback.format_exc())
         raise Exception(output_messages.ERR_EXP_UPD_HTTPD_SSL_CONFIG%(basedefs.FILE_HTTPD_SSL_CONFIG))
 
-def _redirectUrl():
-    try:
-        # Create the Apache configuration fragment from the template:
-        confTemplate = Template(file=basedefs.FILE_OVIRT_HTTPD_CONF_TEMPLATE)
-        confText = str(confTemplate)
-
-        # Save the text produced by the template:
-        fd = open(basedefs.FILE_OVIRT_HTTPD_CONF, 'w')
-        fd.write(confText)
-        fd.close()
-    except:
-        logging.error(traceback.format_exc())
-        raise Exception(output_messages.ERR_CREATE_OVIRT_HTTPD_CONF%(basedefs.FILE_OVIRT_HTTPD_CONF))
-
 def _configureHttpdPort():
     try:
         logging.debug("Update %s to listen in the new HTTP port"%(basedefs.FILE_HTTPD_CONF))
diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index 6bc4b3b..ac7ff77 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -939,6 +939,11 @@ def main(options):
     else:
         logging.info("Info: %s file found. Continue.", basedefs.DB_PASS_FILE)
 
+    startVersion = "3.1"
+
+    if os.path.exists(basedefs.FILE_ENGINE_VERSION):
+        startVersion = utils.getEngineVersion()
+
     # Functions/parameters definitions
     currentDbName = basedefs.DB_NAME
     stopEngineService = [stopEngine]
@@ -1068,6 +1073,10 @@ def main(options):
                 # Bring up any services we shut down before db upgrade
                 startDbRelatedServices(etlService, notificationService)
 
+            if startVersion.startswith("3.1"):
+                runFunc([utils.updateEngineSysconfig], MSG_INFO_UPDATE_ENGINE_SYSCONFIG)
+                messages.append(MSG_OVIRT_ENGINE_RECREATED)
+
             # CA restore
             runFunc([ca.prepare], MSG_INFO_PKI_PREPARE)
 
-- 
1.7.1


From d67734af741ec6ecd1bc91c393af422e4e016073 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Wed, 20 Feb 2013 11:08:45 +0400
Subject: [PATCH 03/13] Add messages

---
 packaging/fedora/setup/engine-upgrade.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index ac7ff77..07429b0 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -125,6 +125,7 @@ MSG_INFO_DB_BACKUP_FILE = "DB Backup available at "
 MSG_INFO_LOG_FILE = "Upgrade log available at"
 MSG_INFO_CHECK_UPDATE = "\nChecking for updates... (This may take several minutes)"
 MSG_INFO_UPGRADE_OK = "%s upgrade completed successfully!" % basedefs.APP_NAME
+MSG_INFO_UPDATE_ENGINE_SYSCONFIG = "Updating service configuration"
 MSG_INFO_STOP_INSTALL_EXIT="Upgrade stopped, Goodbye."
 MSG_INFO_UPDATE_ENGINE_PROFILE="Updating ovirt-engine Profile"
 MSG_INFO_PKI_PREPARE = "Preparing CA"
@@ -143,6 +144,8 @@ MSG_INFO_UUID_VALIDATION_INFO = (
     "."
 )
 
+MSG_OVIRT_ENGINE_RECREATED = "\nINFO: The configuration file %s was backed up and a new\n\
+file with more updated settings was created instead." % basedefs.FILE_OVIRT_HTTPD_CONF
 MSG_ALERT_STOP_ENGINE="\nDuring the upgrade process, %s  will not be accessible.\n\
 All existing running virtual machines will continue but you will not be able to\n\
 start or stop any new virtual machines during the process.\n" % basedefs.APP_NAME
-- 
1.7.1


From fcc6eb940476175279989daca6e1203a908f58e7 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Wed, 20 Feb 2013 15:25:06 +0400
Subject: [PATCH 04/13] Add httpd restart and .pgpass edit

---
 packaging/fedora/setup/engine-upgrade.py |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index 07429b0..599cb4e 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -565,6 +565,13 @@ class CA():
                 except OSError:
                     logging.error("PKI: cannot remove '%s'" % f)
 
+def restartHttpd(service=basedefs.HTTPD_SERVICE_NAME):
+    logging.debug("restart %s service.", service)
+    cmd = [
+        basedefs.EXEC_SERVICE, service, "restart",
+    ]
+    output, rc = utils. execCmd(cmdList=cmd, failOnError=True, msg="Can't restart HTTPD service")
+
 def stopEngine(service=basedefs.ENGINE_SERVICE_NAME):
     logging.debug("stopping %s service.", service)
     cmd = [
@@ -904,6 +911,17 @@ def checkRunningTasks(dbName=basedefs.DB_NAME, service=basedefs.ENGINE_SERVICE_N
                                         engineConfigExtended=engineConfigExtended)
 
 
+def editPgpass(pgpass=""):
+    """
+    Hack to replace engine database with * for user engine
+    """
+
+    logging.debug("Editing file: "+pgpass)
+
+    cmd = [
+        "/bin/sed", "-i", "-e", "s/:engine:engine/:*:engine/", pgpass
+    ]
+    output, rc = utils.execCmd(cmdList=cmd, failOnError=False)
 
 def main(options):
     # BEGIN: PROCESS-INITIALIZATION
@@ -936,6 +954,8 @@ def main(options):
             if not os.path.exists(dbPassFileDirectory):
                 os.makedirs(dbPassFileDirectory)
             shutil.copy(basedefs.ORIG_PASS_FILE, basedefs.DB_PASS_FILE)
+            # Edit .pgpass
+            editPgpass(basedefs.DB_PASS_FILE)
 
             # File is copied/created by root, so no need to verify the owner.
             os.chmod(basedefs.DB_PASS_FILE, 0600)
@@ -1109,6 +1129,8 @@ def main(options):
         finally:
             # start engine
             runFunc([startEngine], MSG_INFO_START_ENGINE % engineService)
+            # restart httpd
+            runFunc([restartHttpd], "Restarting web server")
 
         # Print log location on success
         addAdditionalMessages(etlService.isServiceAvailable())
-- 
1.7.1


From a8a100dc57dce54a0cff36904d05ced1a25f2b3c Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 11:59:05 +0400
Subject: [PATCH 05/13] Add I57c62cf6

---
 packaging/fedora/setup/common_utils.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/packaging/fedora/setup/common_utils.py b/packaging/fedora/setup/common_utils.py
index 5b3ab47..0f99390 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -1603,9 +1603,13 @@ def isApplicationModeGluster(conf):
 
 def getEngineVersion():
     # Just read the info from the file
-    with open(basedefs.FILE_ENGINE_VERSION) as version:
-        return version.readline().rstrip('\n')
-
+    # If the file doesn't exist (on first upgrades), read from rpm
+    if os.path.exists(basedefs.FILE_ENGINE_VERSION):
+        with open(basedefs.FILE_ENGINE_VERSION) as version:
+            return version.readline().rstrip('\n')
+    else:
+        return getRpmVersion()
+ 
 def redirectUrl():
     try:
         # Create the Apache configuration fragment from the template:
-- 
1.7.1


From 913e74e123d97a8ddf75e35649c1dd17912bdbd0 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 12:04:06 +0400
Subject: [PATCH 06/13] Minor changes

---
 packaging/fedora/setup/engine-upgrade.py |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index 599cb4e..57b0358 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -962,10 +962,7 @@ def main(options):
     else:
         logging.info("Info: %s file found. Continue.", basedefs.DB_PASS_FILE)
 
-    startVersion = "3.1"
-
-    if os.path.exists(basedefs.FILE_ENGINE_VERSION):
-        startVersion = utils.getEngineVersion()
+    startVersion = utils.getEngineVersion()
 
     # Functions/parameters definitions
     currentDbName = basedefs.DB_NAME
-- 
1.7.1


From 3bce1c4f402b1251d042f6365aeaee487a348a21 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 12:21:33 +0400
Subject: [PATCH 07/13] Add I47f81d8a

---
 .../ui/common/uicommon/SpiceInterfaceImpl.java     |    9 +++++++--
 .../ovirt/engine/ui/uicommonweb/Configurator.java  |    2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
index a6bc9c7..75a7694 100644
--- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
+++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
@@ -448,8 +448,13 @@ public class SpiceInterfaceImpl implements ISpice {
     public void Connect() {
         logger.warning("Connecting via spice..."); //$NON-NLS-1$
 
-        if ((cat.os.equalsIgnoreCase("Linux")) //$NON-NLS-1$
-                && (cat.browser.equalsIgnoreCase("Firefox"))) { //$NON-NLS-1$
+        if (
+            (cat.os.equalsIgnoreCase("Linux")) //$NON-NLS-1$
+            && (
+               cat.browser.equalsIgnoreCase("Firefox")
+               || cat.browser.equalsIgnoreCase("Chrome")
+               )
+           ) { //$NON-NLS-1$
             connectNativelyViaXPI();
         } else if ((cat.os.equalsIgnoreCase("Windows")) //$NON-NLS-1$
                 && (cat.browser.equalsIgnoreCase("Explorer"))) { //$NON-NLS-1$
diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
index d7ff150..e4a7031 100644
--- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
+++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
@@ -367,7 +367,7 @@ public abstract class Configurator {
     }
 
     public boolean isClientLinuxFirefox() {
-        return clientOsType().equalsIgnoreCase("Linux") && clientBrowserType().equalsIgnoreCase("Firefox"); //$NON-NLS-1$ //$NON-NLS-2$
+        return clientOsType().equalsIgnoreCase("Linux") && (clientBrowserType().equalsIgnoreCase("Firefox")||clientBrowserType().equalsIgnoreCase("Chrome") ); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
     public boolean isClientWindownsExplorer() {
-- 
1.7.1


From f8b52178e0ef620c2695d8c2cb43140415d530e0 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 13:00:44 +0400
Subject: [PATCH 08/13] Minor changes

---
 .../ui/common/uicommon/SpiceInterfaceImpl.java     |    6 +++---
 .../ovirt/engine/ui/uicommonweb/Configurator.java  |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
index 75a7694..65a3341 100644
--- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
+++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
@@ -451,10 +451,10 @@ public class SpiceInterfaceImpl implements ISpice {
         if (
             (cat.os.equalsIgnoreCase("Linux")) //$NON-NLS-1$
             && (
-               cat.browser.equalsIgnoreCase("Firefox")
-               || cat.browser.equalsIgnoreCase("Chrome")
+               cat.browser.equalsIgnoreCase("Firefox") //$NON-NLS-1$
+               || cat.browser.equalsIgnoreCase("Chrome") //$NON-NLS-1$
                )
-           ) { //$NON-NLS-1$
+           ) { 
             connectNativelyViaXPI();
         } else if ((cat.os.equalsIgnoreCase("Windows")) //$NON-NLS-1$
                 && (cat.browser.equalsIgnoreCase("Explorer"))) { //$NON-NLS-1$
diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
index e4a7031..42a1f78 100644
--- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
+++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Configurator.java
@@ -367,7 +367,7 @@ public abstract class Configurator {
     }
 
     public boolean isClientLinuxFirefox() {
-        return clientOsType().equalsIgnoreCase("Linux") && (clientBrowserType().equalsIgnoreCase("Firefox")||clientBrowserType().equalsIgnoreCase("Chrome") ); //$NON-NLS-1$ //$NON-NLS-2$
+        return clientOsType().equalsIgnoreCase("Linux") && (clientBrowserType().equalsIgnoreCase("Firefox")||clientBrowserType().equalsIgnoreCase("Chrome") ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 
     public boolean isClientWindownsExplorer() {
-- 
1.7.1


From 90f61b743266024c3b3deac973e3ca8eaf5318e1 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 13:11:04 +0400
Subject: [PATCH 09/13] Minor changes

---
 .../ui/common/uicommon/SpiceInterfaceImpl.java     |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
index 65a3341..48201e5 100644
--- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
+++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java
@@ -454,7 +454,7 @@ public class SpiceInterfaceImpl implements ISpice {
                cat.browser.equalsIgnoreCase("Firefox") //$NON-NLS-1$
                || cat.browser.equalsIgnoreCase("Chrome") //$NON-NLS-1$
                )
-           ) { 
+           ) {
             connectNativelyViaXPI();
         } else if ((cat.os.equalsIgnoreCase("Windows")) //$NON-NLS-1$
                 && (cat.browser.equalsIgnoreCase("Explorer"))) { //$NON-NLS-1$
-- 
1.7.1


From 44a2f594df5955395eb85999cb4802bf23681f23 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 15:36:58 +0400
Subject: [PATCH 10/13] Minor changes

---
 packaging/fedora/setup/common_utils.py   |    2 ++
 packaging/fedora/setup/engine-upgrade.py |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/packaging/fedora/setup/common_utils.py b/packaging/fedora/setup/common_utils.py
index 0f99390..9a3450c 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -1331,6 +1331,8 @@ def getRpmVersion(rpmName=basedefs.ENGINE_RPM_NAME):
     if len(res) != 1:
         raise Exception(output_messages.ERR_READ_RPM_VER % rpmName)
 
+    logging.debug("Here is result of retrived version: %s-%s" % (res[0]['version'], res[0]['release']))
+
     return "%s-%s" % (res[0]['version'], res[0]['release'])
 
 def installed(rpm):
diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index 57b0358..3da1149 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -924,6 +924,10 @@ def editPgpass(pgpass=""):
     output, rc = utils.execCmd(cmdList=cmd, failOnError=False)
 
 def main(options):
+    # Place getEngineVersion here or new version can't be detected
+    startVersion = utils.getEngineVersion()
+    logging.debug("Start version is %s ", startVersion)
+
     # BEGIN: PROCESS-INITIALIZATION
     miniyumsink = utils.MiniYumSink()
     MiniYum.setup_log_hook(sink=miniyumsink)
@@ -962,7 +966,6 @@ def main(options):
     else:
         logging.info("Info: %s file found. Continue.", basedefs.DB_PASS_FILE)
 
-    startVersion = utils.getEngineVersion()
 
     # Functions/parameters definitions
     currentDbName = basedefs.DB_NAME
-- 
1.7.1


From 6eaa511d12703a3c670fe0d80a230b0c36de6556 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 16:40:50 +0400
Subject: [PATCH 11/13] Minor changes

---
 packaging/fedora/setup/common_utils.py     |    2 --
 packaging/fedora/setup/engine-upgrade.py   |    1 -
 packaging/fedora/spec/ovirt-engine.spec.in |    2 +-
 3 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/packaging/fedora/setup/common_utils.py b/packaging/fedora/setup/common_utils.py
index 9a3450c..0f99390 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -1331,8 +1331,6 @@ def getRpmVersion(rpmName=basedefs.ENGINE_RPM_NAME):
     if len(res) != 1:
         raise Exception(output_messages.ERR_READ_RPM_VER % rpmName)
 
-    logging.debug("Here is result of retrived version: %s-%s" % (res[0]['version'], res[0]['release']))
-
     return "%s-%s" % (res[0]['version'], res[0]['release'])
 
 def installed(rpm):
diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index 3da1149..414ccb7 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -926,7 +926,6 @@ def editPgpass(pgpass=""):
 def main(options):
     # Place getEngineVersion here or new version can't be detected
     startVersion = utils.getEngineVersion()
-    logging.debug("Start version is %s ", startVersion)
 
     # BEGIN: PROCESS-INITIALIZATION
     miniyumsink = utils.MiniYumSink()
diff --git a/packaging/fedora/spec/ovirt-engine.spec.in b/packaging/fedora/spec/ovirt-engine.spec.in
index 43449d9..67cf6f3 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -166,7 +166,7 @@ Requires: python-configobj
 Requires: python-cheetah
 Requires: ovirt-host-deploy-java
 Requires: yum-plugin-versionlock
-Requires: ovirt-engine-cli
+Requires: ovirt-engine-cli >= 3.2
 
 # For local database:
 Requires: postgresql-server >= 8.4.7
-- 
1.7.1


From f622662b200327917fab9888f7a40b0308eb342f Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Thu, 21 Feb 2013 17:22:02 +0400
Subject: [PATCH 12/13] Minor changes

---
 packaging/fedora/setup/common_utils.py   |    2 ++
 packaging/fedora/setup/engine-upgrade.py |    8 +++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/packaging/fedora/setup/common_utils.py b/packaging/fedora/setup/common_utils.py
index 0f99390..9a3450c 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -1331,6 +1331,8 @@ def getRpmVersion(rpmName=basedefs.ENGINE_RPM_NAME):
     if len(res) != 1:
         raise Exception(output_messages.ERR_READ_RPM_VER % rpmName)
 
+    logging.debug("Here is result of retrived version: %s-%s" % (res[0]['version'], res[0]['release']))
+
     return "%s-%s" % (res[0]['version'], res[0]['release'])
 
 def installed(rpm):
diff --git a/packaging/fedora/setup/engine-upgrade.py b/packaging/fedora/setup/engine-upgrade.py
index 414ccb7..a8ead36 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -924,13 +924,15 @@ def editPgpass(pgpass=""):
     output, rc = utils.execCmd(cmdList=cmd, failOnError=False)
 
 def main(options):
-    # Place getEngineVersion here or new version can't be detected
-    startVersion = utils.getEngineVersion()
-
     # BEGIN: PROCESS-INITIALIZATION
     miniyumsink = utils.MiniYumSink()
     MiniYum.setup_log_hook(sink=miniyumsink)
     extraLog = open(logFile, "a")
+
+    # Place getEngineVersion here or new version can't be detected
+    startVersion = utils.getEngineVersion()
+    logging.debug("Start version is %s ", startVersion)
+
     miniyum = MiniYum(sink=miniyumsink, extraLog=extraLog)
     miniyum.selinux_role()
     # END: PROCESS-INITIALIZATION
-- 
1.7.1


From 6f9ebdd71b971c4cf7d56ed735640a96189c0c69 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Wed, 27 Feb 2013 10:13:52 +0400
Subject: [PATCH 13/13] Add Id3aa95b2

---
 .../core/common/businessentities/VmBase.java       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
index 8023f2a..4cf0e9f 100644
--- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
+++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
@@ -30,7 +30,7 @@ import org.ovirt.engine.core.compat.NGuid;
 public class VmBase extends IVdcQueryable implements BusinessEntity<Guid> {
     private static final long serialVersionUID = 1078548170257965614L;
     private ArrayList<DiskImage> images;
-    private final ArrayList<DiskImage> diskList = new ArrayList<DiskImage>();
+    private ArrayList<DiskImage> diskList = new ArrayList<DiskImage>();
     private List<VmNetworkInterface> interfaces;
     private Map<Guid, VmDevice> managedDeviceMap = new HashMap<Guid, VmDevice>();
     private List<VmDevice> unmanagedDeviceList = new ArrayList<VmDevice>();
-- 
1.7.1

