Ohad Basan has uploaded a new change for review.

Change subject: ovirt-live: prepare ovirt-live for ovirt 3.3
......................................................................

ovirt-live: prepare ovirt-live for ovirt 3.3

Change-Id: I3930256ebddb4eed912d216922861f7593d93dea
Signed-off-by: Ohad Basan <oba...@redhat.com>
---
M centos/build.sh
M centos/kickstart/ovirt-live-base.ks
M centos/kickstart/ovirt-live-gnome.ks
M centos/oVirtLiveFiles/engine-setup-yad.sh
M centos/oVirtLiveFiles/ovirt-answer
A centos/oVirtLiveFiles/root/etc/gdm/custom.conf
A 
centos/oVirtLiveFiles/root/etc/ovirt-host-deploy.conf.d/50-vdsm-conf-fake-nic.conf
A centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-dummy0
A centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-eth0
A centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt
A centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-wlan0
A centos/oVirtLiveFiles/root/etc/xdg/autostart/engine-setup.desktop
A centos/oVirtLiveFiles/root/usr/share/applications/ovirt.desktop
A 
centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.lockdown.gschema.override
A 
centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.screensaver.gschema.override
A 
centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override
A 
centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override
A 
centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/__init__.py
A 
centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/core.py
A 
centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/oliveconst.py
M fedora/Makefile
M fedora/kickstart/ovirt.ks
M fedora/oVirtLiveFiles/ovirt-answer
23 files changed, 509 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-live refs/changes/00/19200/1

diff --git a/centos/build.sh b/centos/build.sh
index fcaf4c8..f6a73ce 100755
--- a/centos/build.sh
+++ b/centos/build.sh
@@ -1,14 +1,25 @@
 #!/bin/bash
-yum install -y livecd-tools
-wget -N 
http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/TinyCore-current.iso
-mkdir oVirtLiveFiles/rpms/
-mkdir oVirtLiveFiles/iso/
+if [[ ! $(whoami) == "root" ]]; then
+    echo "Please run as root"
+    exit 1
+fi
+rpm -q livecd-tools >  /dev/null
+if [[ $? -ne 0  ]]; then 
+    yum install -y livecd-tools
+fi
+#wget -N 
http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/TinyCore-current.iso
+if [[ ! -d oVirtLiveFiles/rpms/ ]]; then
+    mkdir oVirtLiveFiles/rpms/
+fi
+if [[ ! -d oVirtLiveFiles/iso/ ]]; then
+    mkdir oVirtLiveFiles/iso/
+fi
 wget -N 
http://kojipkgs.fedoraproject.org//packages/yad/0.14.2/1.fc14/x86_64/yad-0.14.2-1.fc14.x86_64.rpm
 mv -f *.rpm oVirtLiveFiles/rpms
 mv -f *.iso oVirtLiveFiles/iso
 PWD=$(pwd)
 sed -i '/name=local/d' kickstart/ovirt-live-base.ks
-awk -v n=20 -v s="repo \-\-name=local 
\-\-baseurl=file://${PWD}/oVirtLiveFiles\/rpms\/" 'NR == n {print s} {print}' 
kickstart/ovirt-live-base.ks > kickstart/ovirt-live-base.temp
+awk -v n=23 -v s="repo \-\-name=local 
\-\-baseurl=file://${PWD}/oVirtLiveFiles\/rpms\/" 'NR == n {print s} {print}' 
kickstart/ovirt-live-base.ks > kickstart/ovirt-live-base.temp
 mv kickstart/ovirt-live-base.temp kickstart/ovirt-live-base.ks
 rm -f kickstart/ovirt-live-base.temp
 livecd-creator -d -v  --config=kickstart/ovirt-live-gnome.ks --cache=/home 
--fslabel=ovirt-live-el6 > iso.log 2>&1
diff --git a/centos/kickstart/ovirt-live-base.ks 
b/centos/kickstart/ovirt-live-base.ks
index a9140e0..a417424 100644
--- a/centos/kickstart/ovirt-live-base.ks
+++ b/centos/kickstart/ovirt-live-base.ks
@@ -14,13 +14,16 @@
 firewall --enabled --service=mdns
 
 repo --name=base       
--mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+repo --name=updates    
--mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
 repo --name=epel       
--mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
 repo --name=epel-testing 
--baseurl=http://dl.fedoraproject.org/pub/epel/testing/6/x86_64/
-repo --name=ovirt     
--baseurl=http://resources.ovirt.org/releases/3.2/rpm/EL/6/
+repo --name=ovirt     
--baseurl=http://resources.ovirt.org/releases/beta/rpm/EL/6/
+repo --name=gluster   
--baseurl=http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/EPEL.repo/epel-$releasever/$basearch/
+repo --name=glusternoarch 
--baseurl=http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.0/EPEL.repo/epel-$releasever/noarch
+repo --name=local 
--baseurl=file:///ovirt-live2/ovirt-live/centos/oVirtLiveFiles/rpms/
 
 xconfig --startxonboot
-services --enabled=network,sshd --disabled=NetworkManager
-
+services --enabled=network,sshd,nfs --disabled=NetworkManager
 
 ########################################################################
 #
@@ -50,7 +53,6 @@
 busybox
 mailx
 memtest86+
-livecd-tools
 fuse
 wpa_supplicant
 dracut-network
diff --git a/centos/kickstart/ovirt-live-gnome.ks 
b/centos/kickstart/ovirt-live-gnome.ks
index 68f608f..bebccd6 100644
--- a/centos/kickstart/ovirt-live-gnome.ks
+++ b/centos/kickstart/ovirt-live-gnome.ks
@@ -155,19 +155,7 @@
 
 yum localinstall -y /home/liveuser/oVirtLiveFiles/rpms/*.rpm
 
-find /home/liveuser/oVirtLiveFiles/patches -name '*.patch' | sort | while read 
patch; do
-    patch -d /usr/share/ovirt-engine/scripts < "$patch"
-done
-
-#settings up vdsm to use a dummy nic
-cp /home/liveuser/oVirtLiveFiles/50-vdsm-conf-fake-nic.conf 
/etc/ovirt-host-deploy.conf.d/
 echo '10.0.0.1 livecd.localdomain localdomain' >> /etc/hosts
-
-#copying plugin
-cp /home/liveuser/oVirtLiveFiles/ovirt_live_101.py 
/usr/share/ovirt-engine/scripts/plugins/
-
-#copying network files
-cp /home/liveuser/oVirtLiveFiles/etc/sysconfig/network-scripts/* 
/etc/sysconfig/network-scripts/
 
 # remove folders/files that use a lot of diskspace
 # and are not really needed for LiveCD
@@ -179,18 +167,15 @@
 #echo 'blacklist iTCO_vendor_support' >> /etc/modprobe.d/blacklist.conf
 sed -i 's/\#WDMDOPTS/WDMDOPTS/g' /etc/sysconfig/wdmd
 
-
-# Manipulate fqdn validation, so that it is possible to setup with answer file
-sed -i 's/raise Exception(output_messages.ERR_EXP_VALIDATE_PARAM % 
param.getKey("CONF_NAME"))/logging.debug("Failed to validate %s with value 
%s",param,paramValue)/g' /usr/share/ovirt-engine/scripts/engine-setup.py
-
 #configuring autostart
 mkdir -p /home/liveuser/.config/autostart
 
-#copying autostart and desktop shortcuts
-cp /home/liveuser/oVirtLiveFiles/usr/share/applications/* 
/usr/share/applications/
+umask 0027
 
-#link setup in autostart
-cp /usr/share/applications/engine-setup.desktop 
/home/liveuser/.config/autostart/
+# Updating patched files
+cp -r /home/liveuser/oVirtLiveFiles/root/* /
+
+chmod 666 /etc/xdg/autostart/engine-setup.desktop
 
 #setting up wallpaper
 su -c "gconftool-2 -t str -s /desktop/gnome/background/picture_filename 
/home/liveuser/oVirtLiveFiles/images/ovirt-wallpaper-16:9.jpg" - liveuser
diff --git a/centos/oVirtLiveFiles/engine-setup-yad.sh 
b/centos/oVirtLiveFiles/engine-setup-yad.sh
index 3187cf2..a22da26 100755
--- a/centos/oVirtLiveFiles/engine-setup-yad.sh
+++ b/centos/oVirtLiveFiles/engine-setup-yad.sh
@@ -30,7 +30,7 @@
 fi
 
 case $action in
-    automatic*) cmd="sudo /usr/bin/engine-setup 
--answer-file=/home/liveuser/oVirtLiveFiles/ovirt-answer" ;;
+    automatic*) cmd="sudo /usr/bin/engine-setup --offline 
--config=/home/liveuser/oVirtLiveFiles/ovirt-answer" ;;
     interactive*) cmd="gnome-terminal --command=\"sudo 
/usr/bin/engine-setup\";sleep 20" ;;
     *) exit 1 ;;
 esac
diff --git a/centos/oVirtLiveFiles/ovirt-answer 
b/centos/oVirtLiveFiles/ovirt-answer
index 8705f5c..1da11c2 100644
--- a/centos/oVirtLiveFiles/ovirt-answer
+++ b/centos/oVirtLiveFiles/ovirt-answer
@@ -1,26 +1,31 @@
-[general]
-OVERRIDE_HTTPD_CONFIG=yes
-HTTP_PORT=80
-HTTPS_PORT=443
-MAC_RANGE=00:1A:4A:23:01:00-00:1A:4A:23:01:FF
-RANDOM_PASSWORDS=no
-HOST_FQDN=livecd.localdomain
-AUTH_PASS=ovirt
-ORG_NAME=ovirt.org
-DC_TYPE=NFS
-DB_REMOTE_INSTALL=local
-DB_HOST=
-DB_PORT=5432
-DB_ADMIN=postgres
-DB_REMOTE_PASS=
-DB_SECURE_CONNECTION=no
-DB_LOCAL_PASS=oVirt!
-NFS_MP=/usr/local/ovirt/iso
-ISO_DOMAIN_NAME=ISO
-CONFIG_NFS=yes
-OVERRIDE_FIREWALL=none
-CONFIG_ALLINONE=yes
-STORAGE_PATH=/usr/local/ovirt/data
-SUPERUSER_PASS=oVirt!
-APPLICATION_MODE=virt
-
+[environment:default]
+OSETUP_RPMDISTRO/enableUpgrade=bool:False
+OVESETUP_CORE/engineStop=none:None
+OVESETUP_DIALOG/confirmSettings=bool:True
+OVESETUP_DB/database=str:engine
+OVESETUP_DB/fixDbViolations=none:None
+OVESETUP_DB/secured=bool:False
+OVESETUP_DB/securedHostValidation=bool:False
+OVESETUP_DB/host=str:localhost
+OVESETUP_DB/user=str:engine
+OVESETUP_DB/password=str:123456
+OVESETUP_DB/port=int:5432
+OVESETUP_SYSTEM/nfsConfigEnabled=bool:True
+OVESETUP_PKI/organization=str:ovirt.org
+OVESETUP_CONFIG/isoDomainName=str:ISO_DOMAIN
+OVESETUP_CONFIG/isoDomainMountPoint=str:/var/lib/exports/iso
+OVESETUP_CONFIG/adminPassword=str:ovirt
+OVESETUP_CONFIG/applicationMode=str:virt
+OVESETUP_CONFIG/firewallManager=str:firewalld
+OVESETUP_CONFIG/websocketProxyConfig=none:None
+OVESETUP_CONFIG/fqdn=str:livecd.localdomain
+OVESETUP_CONFIG/storageType=str:nfs
+OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True
+OVESETUP_APACHE/configureRootRedirection=bool:True
+OVESETUP_APACHE/configureSsl=bool:True
+OSETUP_RPMDISTRO/requireRollback=none:None
+OSETUP_RPMDISTRO/enableUpgrade=none:None
+OVESETUP_AIO/configure=bool:True
+OVESETUP_AIO/storageDomainDir=str:/var/lib/images
+OVESETUP_AIO/rootPassword=str:ovirt
+OVESETUP_AIO/storageDomainName=str:local_storage
diff --git a/centos/oVirtLiveFiles/root/etc/gdm/custom.conf 
b/centos/oVirtLiveFiles/root/etc/gdm/custom.conf
new file mode 100644
index 0000000..d5e6058
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/etc/gdm/custom.conf
@@ -0,0 +1,4 @@
+[daemon]
+AutomaticLoginEnable=True
+AutomaticLogin=liveuser
+
diff --git 
a/centos/oVirtLiveFiles/root/etc/ovirt-host-deploy.conf.d/50-vdsm-conf-fake-nic.conf
 
b/centos/oVirtLiveFiles/root/etc/ovirt-host-deploy.conf.d/50-vdsm-conf-fake-nic.conf
new file mode 100644
index 0000000..ada282b
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/etc/ovirt-host-deploy.conf.d/50-vdsm-conf-fake-nic.conf
@@ -0,0 +1,2 @@
+[environment:init]
+VDSM_CONFIG/vars/fake_nics=str:dummy0
diff --git 
a/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-dummy0 
b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-dummy0
new file mode 100644
index 0000000..afae7d6
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-dummy0
@@ -0,0 +1,8 @@
+DEVICE=dummy0
+BOOTPROTO=none
+ONBOOT=yes
+HOTPLUG=no
+NM_CONTROLLED=no
+BRIDGE=ovirtmgmt
+PROMISC=yes
+
diff --git 
a/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-eth0 
b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-eth0
new file mode 100644
index 0000000..96d760f
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-eth0
@@ -0,0 +1,4 @@
+DEVICE=eth0
+BOOTPROTO=none
+ONBOOT=yes
+
diff --git 
a/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt 
b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt
new file mode 100644
index 0000000..136b3ad
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt
@@ -0,0 +1,9 @@
+DEVICE=ovirtmgmt
+TYPE=Bridge
+BOOTPROTO=static
+ONBOOT=yes
+DELAY=0
+NM_CONTROLLED=no
+IPADDR=10.0.0.1
+NETMASK=255.255.255.0
+
diff --git 
a/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-wlan0 
b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-wlan0
new file mode 100644
index 0000000..d6903d4
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/etc/sysconfig/network-scripts/ifcfg-wlan0
@@ -0,0 +1,4 @@
+DEVICE=wlan0
+BOOTPROTO=dhcp
+ONBOOT=yes
+
diff --git a/centos/oVirtLiveFiles/root/etc/xdg/autostart/engine-setup.desktop 
b/centos/oVirtLiveFiles/root/etc/xdg/autostart/engine-setup.desktop
new file mode 100644
index 0000000..f582541
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/etc/xdg/autostart/engine-setup.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Version=1.0
+Name=oVirt-setup
+Name[en_US]=engine-setup
+Exec=/usr/bin/gnome-terminal -e "bash -c 
/home/liveuser/oVirtLiveFiles/engine-setup-yad.sh;bash"
+X-GNOME-Autostart-enabled=true
+X-GNOME-Autostart-Delay=5
+Icon=/home/liveuser/oVirtLiveFiles/images/ovirt-icon-128.png
+
diff --git a/centos/oVirtLiveFiles/root/usr/share/applications/ovirt.desktop 
b/centos/oVirtLiveFiles/root/usr/share/applications/ovirt.desktop
new file mode 100644
index 0000000..1022bbe
--- /dev/null
+++ b/centos/oVirtLiveFiles/root/usr/share/applications/ovirt.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Version=1.0
+Name=oVirt-Engine
+Exec=/bin/firefox https://localhost.localdomain
+X-GNOME-Autostart-enabled=true
+X-GNOME-Autostart-Delay=10
+StartupNotify=true
+Icon=/home/oVirtuser/oVirtLiveFiles/images/ovirt-icon-128.png
+
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.lockdown.gschema.override
 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.lockdown.gschema.override
new file mode 100644
index 0000000..18d7f9b
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.lockdown.gschema.override
@@ -0,0 +1,3 @@
+[org.gnome.desktop.lockdown]
+disable-lock-screen=true
+
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.screensaver.gschema.override
 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.screensaver.gschema.override
new file mode 100644
index 0000000..ae0eca4
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.desktop.screensaver.gschema.override
@@ -0,0 +1,3 @@
+[org.gnome.desktop.screensaver]
+lock-enabled=false
+
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override
 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override
new file mode 100644
index 0000000..0799bc6
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override
@@ -0,0 +1,3 @@
+[org.gnome.settings-daemon.plugins.updates]
+active=false
+
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override
 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override
new file mode 100644
index 0000000..04bbf8d
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override
@@ -0,0 +1,3 @@
+[org.gnome.shell]
+favorite-apps=['ovirt.desktop' , 'engine-setup.desktop','firefox.desktop', 
'evolution.desktop', 'empathy.desktop', 'shotwell.desktop', 'nautilus.desktop', 
'anaconda.desktop']
+
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/__init__.py
 
b/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/__init__.py
new file mode 100644
index 0000000..7e34015
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/__init__.py
@@ -0,0 +1,35 @@
+#
+# ovirt-engine-setup -- ovirt engine setup
+# Copyright (C) 2013 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+"""
+ovirt-host-setup ovirtLive plugin.
+"""
+
+
+from otopi import util
+
+
+from . import core
+
+
+@util.export
+def createPlugins(context):
+    core.Plugin(context=context)
+
+
+# vim: expandtab tabstop=4 shiftwidth=4
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/core.py
 
b/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/core.py
new file mode 100644
index 0000000..40fa2a2
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/core.py
@@ -0,0 +1,233 @@
+#
+# ovirt-engine-setup -- ovirt engine setup
+# Copyright (C) 2013 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+"""
+oVirtLive plugin.
+"""
+
+import time
+import os
+import shutil
+import glob
+import gettext
+_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
+
+
+from otopi import util
+from otopi import plugin
+from otopi import filetransaction
+from otopi import constants as otopicons
+
+
+import oliveconst
+
+
+from ovirt_engine_setup import util as osetuputil
+from ovirt_engine_setup import constants as osetupcons
+from ovirt_engine_setup import dialog
+
+
+@util.export
+class Plugin(plugin.PluginBase):
+    """
+    oVirtLive plugin.
+    """
+
+    def __init__(self, context):
+        super(Plugin, self).__init__(context=context)
+        self._enabled = True
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_INIT,
+    )
+    def _init(self):
+        self.environment.setdefault(
+            oliveconst.CoreEnv.ENABLE
+        )
+        self.environment.setdefault(
+            oliveconst.IsoEnv.ISO_NAME,
+            oliveconst.Defaults.DEFAULT_ISO_NAME
+        )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_SETUP,
+        condition=lambda self: self.environment[
+            oliveconst.CoreEnv.ENABLE
+        ],
+    )
+    def _setup(self):
+        self._enabled = True
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_VALIDATION,
+    )
+    def _validation(self):
+        import ovirtsdk.api
+        import ovirtsdk.xml
+        self._ovirtsdk_api = ovirtsdk.api
+        self._ovirtsdk_xml = ovirtsdk.xml
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_CLOSEUP,
+        condition=lambda self: self._enabled,
+        name=oliveconst.Stages.INIT,
+        before=(
+            oliveconst.Stages.CONFIG_STORAGE,
+        ),
+        after=(
+            osetupcons.Stages.AIO_CONFIG_VDSM,
+        ),
+    )
+    def _initapi(self):
+        self._engine_api = self._ovirtsdk_api.API(
+            url='https://{fqdn}:{port}/api'.format(
+                fqdn=self.environment[osetupcons.ConfigEnv.FQDN],
+                port=self.environment[osetupcons.ConfigEnv.PUBLIC_HTTPS_PORT],
+            ),
+            username='{user}@{domain}'.format(
+                user=osetupcons.Const.USER_ADMIN,
+                domain=osetupcons.Const.DOMAIN_INTERNAL,
+            ),
+            password=self.environment[osetupcons.ConfigEnv.ADMIN_PASSWORD],
+            ca_file=osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_CERT,
+        )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_CLOSEUP,
+        condition=lambda self: self._enabled,
+        name=oliveconst.Stages.CONFIG_STORAGE,
+        before=(
+            oliveconst.Stages.COPY_ISO,
+        ),
+        after=(
+            oliveconst.Stages.INIT,
+        ),
+    )
+    def _createstorage(self):
+        self.logger.debug('Attaching iso domain')
+        time.sleep(10)
+        self._engine_api.datacenters.get(
+            self.environment[
+                oliveconst.CoreEnv.LOCAL_DATA_CENTER
+            ]
+        ).storagedomains.add(
+            self._engine_api.storagedomains.get(
+                self.environment[
+                   oliveconst.IsoEnv.ISO_NAME
+                ]
+            )
+        )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_CLOSEUP,
+        condition=lambda self: self._enabled,
+        name=oliveconst.Stages.COPY_ISO,
+        before=(
+            oliveconst.Stages.CREATE_VM,
+        ),
+        after=(
+            oliveconst.Stages.CONFIG_STORAGE,
+        ),
+    )
+    def _copyiso(self):
+        self.logger.debug('Copying Iso Files')
+        fileList = glob.glob('/home/liveuser/oVirtLiveFiles/iso/*.iso')
+        targetPath = os.path.join(
+            self.environment[
+                osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT
+            ],
+            self.environment[
+                osetupcons.ConfigEnv.ISO_DOMAIN_SD_UUID
+            ],
+            'images',
+            osetupcons.Const.ISO_DOMAIN_IMAGE_UID
+        )
+        self.logger.debug('target path' + targetPath)
+        for filename in fileList:
+            self.logger.debug(filename)
+            shutil.move(filename, targetPath)
+            os.chown(
+                os.path.join(targetPath, os.path.basename(filename)),
+                osetuputil.getUid(
+                        osetupcons.Defaults.DEFAULT_SYSTEM_USER_VDSM
+                ),
+                osetuputil.getGid(
+                        osetupcons.Defaults.DEFAULT_SYSTEM_GROUP_KVM
+                )
+            )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_CLOSEUP,
+        condition=lambda self: self._enabled,
+        name=oliveconst.Stages.CREATE_VM,
+        after=(
+            oliveconst.Stages.COPY_ISO,
+        ),
+    )
+    def _createvm(self):
+        # Defins OS param for the boot option
+        params = self._ovirtsdk_xml.params
+        os = params.OperatingSystem(
+            type_='unassigned',
+            boot=(
+                params.Boot(dev='cdrom'),
+                params.Boot(dev='hd'),
+            ),
+        )
+        MB = 1024*1024
+        GB = 1024*MB
+
+        # Create VM
+        vm = self._engine_api.vms.add(
+            params.VM(
+                name='local_vm',
+                memory=1*GB,
+                os=os,
+                cluster=self._engine_api.clusters.get('local_cluster'),
+                template=self._engine_api.templates.get('Blank'),
+            ),
+        )
+
+        # Create NIC
+        self._engine_api.vms.get('local_vm').nics.add(
+            params.NIC(
+                name='eth0',
+                network=params.Network(name='ovirtmgmt'),
+                interface='virtio',
+            ),
+        )
+
+        diskParam = params.Disk(
+            storage_domains=params.StorageDomains(
+                storage_domain=(
+                    self._engine_api.storagedomains.get('local_storage'),
+                ),
+            ),
+            size=6*GB,
+            type_='data',
+            interface='virtio',
+            format='cow',
+            bootable=True,
+        )
+
+        self._engine_api.vms.get(
+            'local_vm'
+        ).disks.add(diskParam)
+
+
+# vim: expandtab tabstop=4 shiftwidth=4
diff --git 
a/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/oliveconst.py
 
b/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/oliveconst.py
new file mode 100644
index 0000000..e86e683
--- /dev/null
+++ 
b/centos/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/oliveconst.py
@@ -0,0 +1,80 @@
+#
+# ovirt-engine-setup -- ovirt engine setup
+# Copyright (C) 2013 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import gettext
+_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
+
+from otopi import util
+from ovirt_engine_setup import constants as osetupcons
+
+
+@util.export
+class Stages(object):
+    CONFIG_STORAGE = 'ovirtlivesetup.core.core.configstorage'
+    COPY_ISO = 'ovirtlivesetup.core.copy.iso'
+    CREATE_VM = 'ovirtlivesetup.core.create.vm'
+    INIT = 'ovirtlivesetup.core.init'
+
+
+@util.export
+@util.codegen
+@osetupcons.osetupattrsclass
+class CoreEnv(object):
+    ENABLE = 'OVESETUP_OVIRTLIVE/enable'
+
+    CONFIGURE = 'OVESETUP_OL/configure'
+    LOCAL_DATA_CENTER = 'OVESETUP_AIO/localDataCenter'
+    LOCAL_CLUSTER = 'OVESETUP_AIO/localCluster'
+    LOCAL_HOST = 'OVESETUP_AIO/localHost'
+    VDSM_CPU = 'OVESETUP_AIO/vdsmCpu'
+
+    STORAGE_DOMAIN_SD_UUID = 'OVESETUP_AIO/storageDomainSdUuid'
+    STORAGE_DOMAIN_DEFAULT_DIR = 'OVESETUP_AIO/storageDomainDefaultDir'
+
+    @osetupcons.osetupattrs(
+        answerfile=True,
+        summary=True,
+        description=_('Local storage domain directory'),
+    )
+    def STORAGE_DOMAIN_DIR(self):
+        return 'OVESETUP_AIO/storageDomainDir'
+
+    STORAGE_DOMAIN_NAME = 'OVESETUP_AIO/storageDomainName'
+
+
+@util.export
+@osetupcons.osetupattrsclass
+class Defaults(object):
+    DEFAULT_LOCAL_DATA_CENTER = 'local_datacenter'
+    DEFAULT_LOCAL_CLUSTER = 'local_cluster'
+    DEFAULT_LOCAL_HOST = 'local_host'
+    DEFAULT_STORAGE_DOMAIN_NAME = 'local_storage'
+    DEFAULT_ISO_NAME = 'ISO_DOMAIN'
+
+@util.export
+@util.codegen
+@osetupcons.osetupattrsclass
+class IsoEnv(object):
+    ISO_NAME = 'ISO_DOMAIN'
+
+@util.export
+@util.codegen
+class Const(object):
+    MINIMUM_SPACE_STORAGEDOMAIN_MB = 10240
+
+
+# vim: expandtab tabstop=4 shiftwidth=4
diff --git a/fedora/Makefile b/fedora/Makefile
index 63ce180..54f58a0 100644
--- a/fedora/Makefile
+++ b/fedora/Makefile
@@ -27,16 +27,17 @@
 iso:
        cp -f /usr/share/spin-kickstarts/fedora-live-base.ks 
kickstart/ovirt-live-base.ks
        sed -i -e 's/selinux \-\-enforcing/selinux \-\-permissive/g' \
-            -e 's/services \-\-enabled\=NetworkManager 
\-\-disabled\=network\,sshd/services \-\-enabled\=NetworkManager\,sshd 
\-\-disabled\=network\,firewalld\nrepo \-\-name\=ovirt 
\-\-baseurl\=http:\/\/ovirt.org\/releases\/stable\/rpm\/Fedora\/18/g' \
+            -e 's/services \-\-enabled\=NetworkManager 
\-\-disabled\=network\,sshd/services \-\-enabled\=NetworkManager\,sshd 
\-\-disabled\=network\,firewalld\nrepo \-\-name\=ovirt 
\-\-baseurl\=http:\/\/ovirt.org\/releases\/stable\/rpm\/Fedora\/19/g' \
              -e 's/liveuser/oVirtuser/g' \
              -e 's/firewall \-\-enabled/firewall \-\-disabled/g' \
              -e 's/livedir\=\"LiveOS\"/livedir\=\"LiveoVirt\"/g' \
              -e "s/\(^.*stop.*atd\..*:\)/\1\nmodprobe dummy/g" 
kickstart/ovirt-live-base.ks
 
        wget -N 
http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/TinyCore-current.iso
-       wget -N 
http://download.fedoraproject.org/pub/fedora/linux/releases/18/Live/x86_64/Fedora-18-x86_64-Live-Desktop.iso
-       mkdir oVirtLiveFiles/iso
-
+       wget -N 
http://download.fedoraproject.org/pub/fedora/linux/releases/19/Live/x86_64/Fedora-Live-Desktop-x86_64-19-1.iso
+       if [[ ! -d oVirtLiveFiles/iso ]]; then
+            mkdir oVirtLiveFiles/iso 
+        fi
        mv -f *.iso oVirtLiveFiles/iso
 
        livecd-creator -d -v  \
@@ -50,7 +51,7 @@
 nightly-iso:
        cp -f /usr/share/spin-kickstarts/fedora-live-base.ks 
kickstart/ovirt-live-base.ks
        sed -i -e 's/selinux \-\-enforcing/selinux \-\-permissive/g' \
-            -e 's/services \-\-enabled\=NetworkManager 
\-\-disabled\=network\,sshd/services \-\-enabled\=NetworkManager\,sshd 
\-\-disabled\=network\,firewalld\nrepo \-\-name\=ovirt 
\-\-baseurl\=http:\/\/ovirt.org\/releases\/nightly\/rpm\/Fedora\/18/g' \
+            -e 's/services \-\-enabled\=NetworkManager 
\-\-disabled\=network\,sshd/services \-\-enabled\=NetworkManager\,sshd 
\-\-disabled\=network\,firewalld\nrepo \-\-name\=ovirt 
\-\-baseurl\=http:\/\/ovirt.org\/releases\/nightly\/rpm\/Fedora\/19/g' \
              -e 's/liveuser/oVirtuser/g' \
              -e 's/firewall \-\-enabled/firewall \-\-disabled/g' \
              -e 's/livedir\=\"LiveOS\"/livedir\=\"LiveoVirt\"/g' \
diff --git a/fedora/kickstart/ovirt.ks b/fedora/kickstart/ovirt.ks
index bb893d4..e018cd2 100644
--- a/fedora/kickstart/ovirt.ks
+++ b/fedora/kickstart/ovirt.ks
@@ -118,8 +118,6 @@
     patch -d /usr/share/ovirt-engine/scripts < "$patch"
 done
 
-
-
 # Configuring autologin
 sed -i 
's/\[daemon\]/\[daemon\]\nAutomaticLoginEnable\=True\nAutomaticLogin\=oVirtuser/g'
 /etc/gdm/custom.conf
 
@@ -135,9 +133,6 @@
 
 glib-compile-schemas /usr/share/glib-2.0/schemas
 
-#workaround for bz 878119
-#echo 'blacklist iTCO_wdt' >> /etc/modprobe.d/blacklist.conf
-#echo 'blacklist iTCO_vendor_support' >> /etc/modprobe.d/blacklist.conf
 sed -i 's/#WDMDOPTS/WDMDOPTS/g' /etc/sysconfig/wdmd
 yum localinstall -y /home/oVirtuser/oVirtLiveFiles/rpms/*.rpm
 
@@ -146,11 +141,9 @@
 # Updating patched files
 cp -r /home/oVirtuser/root/* /
 
-
 # Manipulate fqdn validation, so that it is possible to setup with answer file
 sed -i 's/raise Exception(output_messages.ERR_EXP_VALIDATE_PARAM % 
param.getKey("CONF_NAME"))/logging.debug("Failed to validate %s with value 
%s",param,paramValue)/g' /usr/share/ovirt-engine/scripts/engine-setup.py
 sed -i -e 's/\(^SELINUX=\).*$/\1permissive/' /etc/selinux/config
-# yad script - give some gui to installation
 
 echo "Finishing post section"
 %end
diff --git a/fedora/oVirtLiveFiles/ovirt-answer 
b/fedora/oVirtLiveFiles/ovirt-answer
index b8f40c0..cb927b2 100644
--- a/fedora/oVirtLiveFiles/ovirt-answer
+++ b/fedora/oVirtLiveFiles/ovirt-answer
@@ -1,25 +1,31 @@
-[general]
-OVERRIDE_HTTPD_CONFIG=yes
-HTTP_PORT=80
-HTTPS_PORT=443
-MAC_RANGE=00:1A:4A:23:01:00-00:1A:4A:23:01:FF
-RANDOM_PASSWORDS=no
-HOST_FQDN=ovirtlive.localdomain
-AUTH_PASS=ovirt
-ORG_NAME=ovirt.org
-DC_TYPE=NFS
-DB_REMOTE_INSTALL=local
-DB_HOST=
-DB_PORT=5432
-DB_ADMIN=postgres
-DB_REMOTE_PASS=
-DB_SECURE_CONNECTION=no
-DB_LOCAL_PASS=oVirt!
-NFS_MP=/usr/local/ovirt/iso
-ISO_DOMAIN_NAME=ISO
-CONFIG_NFS=yes
-OVERRIDE_FIREWALL=none
-CONFIG_ALLINONE=yes
-STORAGE_PATH=/usr/local/ovirt/data
-SUPERUSER_PASS=oVirt!
-APPLICATION_MODE=virt
+[environment:default]
+OSETUP_RPMDISTRO/enableUpgrade=bool:False
+OVESETUP_CORE/engineStop=none:None
+OVESETUP_DIALOG/confirmSettings=bool:True
+OVESETUP_DB/database=str:engine
+OVESETUP_DB/fixDbViolations=none:None
+OVESETUP_DB/secured=bool:False
+OVESETUP_DB/securedHostValidation=bool:False
+OVESETUP_DB/host=str:localhost
+OVESETUP_DB/user=str:engine
+OVESETUP_DB/password=str:123456
+OVESETUP_DB/port=int:5432
+OVESETUP_SYSTEM/nfsConfigEnabled=bool:True
+OVESETUP_PKI/organization=str:ovirt.org
+OVESETUP_CONFIG/isoDomainName=str:ISO_DOMAIN
+OVESETUP_CONFIG/isoDomainMountPoint=str:/var/lib/exports/iso
+OVESETUP_CONFIG/adminPassword=str:123456
+OVESETUP_CONFIG/applicationMode=str:virt
+OVESETUP_CONFIG/firewallManager=str:firewalld
+OVESETUP_CONFIG/websocketProxyConfig=none:None
+OVESETUP_CONFIG/fqdn=str:dhcp-1-12.tlv.redhat.com
+OVESETUP_CONFIG/storageType=str:nfs
+OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True
+OVESETUP_APACHE/configureRootRedirection=bool:True
+OVESETUP_APACHE/configureSsl=bool:True
+OSETUP_RPMDISTRO/requireRollback=none:None
+OSETUP_RPMDISTRO/enableUpgrade=none:None
+OVESETUP_AIO/configure=bool:True
+OVESETUP_AIO/storageDomainDir=str:/var/lib/images
+OVESETUP_AIO/rootPassword=str:ovirt
+


-- 
To view, visit http://gerrit.ovirt.org/19200
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3930256ebddb4eed912d216922861f7593d93dea
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-live
Gerrit-Branch: master
Gerrit-Owner: Ohad Basan <oba...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to