From 8e55e20f28ec6d0928f26227485619dc0b65353f Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Tue, 15 Jan 2013 16:35:06 +0100 Subject: [PATCH] Move burnin to ganeti.tools.burnin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to other scripts, βtools/burninβ just becomes a wrapper script. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- .gitignore | 1 + Makefile.am | 5 ++++- autotools/build-bash-completion | 3 ++- tools/burnin => lib/tools/burnin.py | 6 +----- 4 files changed, 8 insertions(+), 7 deletions(-) rename tools/burnin => lib/tools/burnin.py (99%) diff --git a/.gitignore b/.gitignore index e46c2e126..b4e115c80 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,7 @@ # tools /tools/kvm-ifup +/tools/burnin /tools/ensure-dirs /tools/vcluster-setup /tools/node-cleanup diff --git a/Makefile.am b/Makefile.am index 2d130ef69..7363eadb7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -340,6 +340,7 @@ server_PYTHON = \ pytools_PYTHON = \ lib/tools/__init__.py \ + lib/tools/burnin.py \ lib/tools/ensure_dirs.py \ lib/tools/node_cleanup.py \ lib/tools/node_daemon_setup.py \ @@ -701,6 +702,7 @@ PYTHON_BOOTSTRAP_SBIN = \ PYTHON_BOOTSTRAP = \ $(PYTHON_BOOTSTRAP_SBIN) \ + tools/burnin \ tools/ensure-dirs \ tools/node-cleanup \ tools/node-daemon-setup \ @@ -799,7 +801,6 @@ nodist_sbin_SCRIPTS += src/ganeti-confd endif python_scripts = \ - tools/burnin \ tools/cfgshell \ tools/cfgupgrade \ tools/cfgupgrade12 \ @@ -829,6 +830,7 @@ pkglib_python_scripts = \ tools/check-cert-expired nodist_pkglib_python_scripts = \ + tools/burnin \ tools/ensure-dirs \ tools/node-daemon-setup \ tools/prepare-node-join @@ -1496,6 +1498,7 @@ $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@)) daemons/ganeti-watcher: MODULE = ganeti.watcher scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@)) +tools/burnin: MODULE = ganeti.tools.burnin tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion index 7e24db98f..49ad9c541 100755 --- a/autotools/build-bash-completion +++ b/autotools/build-bash-completion @@ -39,6 +39,8 @@ from ganeti import utils from ganeti import build from ganeti import pathutils +from ganeti.tools import burnin + # _autoconf shouldn't be imported from anywhere except constants.py, but we're # making an exception here because this script is only used at build time. from ganeti import _autoconf @@ -838,7 +840,6 @@ def main(): build.LoadModule(filename))) # Burnin script - burnin = build.LoadModule("tools/burnin") WriteCompletion(sw, "%s/burnin" % pathutils.TOOLSDIR, "_ganeti_burnin", debug, opts=burnin.OPTIONS, args=burnin.ARGUMENTS) diff --git a/tools/burnin b/lib/tools/burnin.py similarity index 99% rename from tools/burnin rename to lib/tools/burnin.py index 42b74d27a..b4fc958a2 100755 --- a/tools/burnin +++ b/lib/tools/burnin.py @@ -1153,7 +1153,7 @@ class Burner(object): return constants.EXIT_SUCCESS -def main(): +def Main(): """Main function. """ @@ -1161,7 +1161,3 @@ def main(): debug=False, stderr_logging=True) return Burner().BurninCluster() - - -if __name__ == "__main__": - main() -- GitLab