Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: setup: use offline packager
......................................................................

packaging: setup: use offline packager

hosted-engine --deploy doesn't need the package manager
for performing the deployment.
Avoiding to hold the yum lock and to require internet
connection during the process.

Change-Id: Ie004dd7a055a2a68f0bac8dd628a0e5e242ebc96
Signed-off-by: Sandro Bonazzola <[email protected]>
---
M src/bin/ovirt-hosted-engine-setup
M src/plugins/ovirt-hosted-engine-setup/core/Makefile.am
M src/plugins/ovirt-hosted-engine-setup/core/__init__.py
A src/plugins/ovirt-hosted-engine-setup/core/offlinepackager.py
4 files changed, 68 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/15/17715/1

diff --git a/src/bin/ovirt-hosted-engine-setup 
b/src/bin/ovirt-hosted-engine-setup
index fe553ed..7a0a1f0 100755
--- a/src/bin/ovirt-hosted-engine-setup
+++ b/src/bin/ovirt-hosted-engine-setup
@@ -36,7 +36,8 @@
        exit 1
 }
 
-environment=""
+environment="OVESETUP_CORE/offlinePackager=bool:True"
+environment="${environment} PACKAGER/yumpackagerEnabled=bool:False"
 
 while [ -n "$1" ]; do
        x="$1"
diff --git a/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am 
b/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am
index 8d47f5b..aeea8da 100644
--- a/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am
+++ b/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am
@@ -29,6 +29,7 @@
        misc.py \
        conf.py \
        answerfile.py \
+       offlinepackager.py \
        shell.py \
        $(NULL)
 
diff --git a/src/plugins/ovirt-hosted-engine-setup/core/__init__.py 
b/src/plugins/ovirt-hosted-engine-setup/core/__init__.py
index ba685d3..da228df 100644
--- a/src/plugins/ovirt-hosted-engine-setup/core/__init__.py
+++ b/src/plugins/ovirt-hosted-engine-setup/core/__init__.py
@@ -27,6 +27,7 @@
 from . import misc
 from . import conf
 from . import answerfile
+from . import offlinepackager
 from . import shell
 
 
@@ -35,6 +36,7 @@
     misc.Plugin(context=context)
     conf.Plugin(context=context)
     answerfile.Plugin(context=context)
+    offlinepackager.Plugin(context=context)
     shell.Plugin(context=context)
 
 
diff --git a/src/plugins/ovirt-hosted-engine-setup/core/offlinepackager.py 
b/src/plugins/ovirt-hosted-engine-setup/core/offlinepackager.py
new file mode 100644
index 0000000..86bb122
--- /dev/null
+++ b/src/plugins/ovirt-hosted-engine-setup/core/offlinepackager.py
@@ -0,0 +1,63 @@
+#
+# ovirt-hosted-engine-setup -- ovirt hosted engine setup
+# Copyright (C) 2013 Red Hat, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+"""Fake packager for offline mode"""
+
+
+import gettext
+
+
+from otopi import constants as otopicons
+from otopi import packager
+from otopi import util
+from otopi import plugin
+
+
+_ = lambda m: gettext.dgettext(message=m, domain='ovirt-hosted-engine-setup')
+
+
[email protected]
+class Plugin(plugin.PluginBase, packager.PackagerBase):
+    """Offline packager."""
+
+    def install(self, packages, ignoreErrors=False):
+        pass
+
+    def update(self, packages, ignoreErrors=False):
+        pass
+
+    def queryPackages(self, patterns=None):
+        return []
+
+    def __init__(self, context):
+        super(Plugin, self).__init__(context=context)
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_INIT,
+        after=(
+            otopicons.Stages.PACKAGERS_DETECTION,
+        ),
+    )
+    def _init(self):
+        self.logger.debug('Registering offline packager')
+        self.context.registerPackager(packager=self)
+
+
+# vim: expandtab tabstop=4 shiftwidth=4


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie004dd7a055a2a68f0bac8dd628a0e5e242ebc96
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to