summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 08:19:09 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 08:19:09 -0400
commit317d3087459538877100032733477362f456f550 (patch)
tree27fabdff3649c75bcdd9de8ccde5c5826c679e5e /tools
parent9d5e8170292e17d3b087878918562dcf502f70d4 (diff)
parenta519dc9298317b678bca43597892df5aa13d874d (diff)
downloadbcfg2-317d3087459538877100032733477362f456f550.tar.gz
bcfg2-317d3087459538877100032733477362f456f550.tar.bz2
bcfg2-317d3087459538877100032733477362f456f550.zip
Merge branch 'maint'
Conflicts: doc/server/plugins/generators/cfg.txt doc/server/plugins/generators/tcheetah.txt src/lib/Bcfg2/Server/Admin/Xcmd.py src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
Diffstat (limited to 'tools')
-rwxr-xr-xtools/bcfg2-profile-templates.py15
-rwxr-xr-xtools/export.py42
2 files changed, 48 insertions, 9 deletions
diff --git a/tools/bcfg2-profile-templates.py b/tools/bcfg2-profile-templates.py
index 93314f1e3..f4069e454 100755
--- a/tools/bcfg2-profile-templates.py
+++ b/tools/bcfg2-profile-templates.py
@@ -5,6 +5,7 @@
import sys
import time
import math
+import signal
import logging
import operator
import Bcfg2.Logger
@@ -17,6 +18,19 @@ def stdev(nums):
return math.sqrt(sum((n - mean)**2 for n in nums) / float(len(nums)))
+def get_sigint_handler(core):
+ """ Get a function that handles SIGINT/Ctrl-C by shutting down the
+ core and exiting properly."""
+
+ def hdlr(sig, frame): # pylint: disable=W0613
+ """ Handle SIGINT/Ctrl-C by shutting down the core and exiting
+ properly. """
+ core.shutdown()
+ os._exit(1) # pylint: disable=W0212
+
+ return hdlr
+
+
def main():
optinfo = dict(
client=Bcfg2.Options.Option("Benchmark templates for one client",
@@ -49,6 +63,7 @@ def main():
logger = logging.getLogger(sys.argv[0])
core = Bcfg2.Server.Core.BaseCore(setup)
+ signal.signal(signal.SIGINT, get_sigint_handler(core))
logger.info("Bcfg2 server core loaded")
core.load_plugins()
logger.debug("Plugins loaded")
diff --git a/tools/export.py b/tools/export.py
index 0f4724e6b..7c3c56db2 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -136,8 +136,7 @@ E.G. 1.2.0pre1 is a valid version.
tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version)
- newchangelog = \
-"""bcfg2 (%s-0.0) unstable; urgency=low
+ newchangelog = """bcfg2 (%s-0.0) unstable; urgency=low
* New upstream release
@@ -177,7 +176,9 @@ E.G. 1.2.0pre1 is a valid version.
"- New upstream release\n", "\n"]
# write out the new RPM changelog
- specs = ["misc/bcfg2.spec", "misc/bcfg2-selinux.spec", "redhat/bcfg2.spec.in"]
+ specs = ["misc/bcfg2.spec",
+ "misc/bcfg2-selinux.spec",
+ "redhat/bcfg2.spec.in"]
if options.dryrun:
print("*** Add the following to the top of the %%changelog section in %s:\n%s\n"
% (rpmchangelog, " and ".join(specs)))
@@ -227,6 +228,29 @@ E.G. 1.2.0pre1 is a valid version.
'VERSION="%s"\n' % version,
startswith=True,
dryrun=options.dryrun)
+ # update solaris IPS version
+ find_and_replace('solaris-ips/Makefile', 'VERS=',
+ 'VERS=%s-1\n' % version,
+ startswith=True,
+ dryrun=options.dryrun)
+ find_and_replace('solaris-ips/MANIFEST.bcfg2.header',
+ 'set name=pkg.fmri value="pkg://bcfg2/bcfg2@',
+ 'set name=pkg.fmri value="pkg://bcfg2/bcfg2@%s"' % version,
+ startswith=True,
+ dryrun=options.dryrun)
+ find_and_replace('solaris-ips/MANIFEST.bcfg2-server.header',
+ 'set name=pkg.fmri value="pkg://bcfg2/bcfg2-server@',
+ 'set name=pkg.fmri value="pkg://bcfg2/bcfg2-server@%s"' % version,
+ startswith=True,
+ dryrun=options.dryrun)
+ find_and_replace('solaris-ips/pkginfo.bcfg2', 'VERSION=',
+ 'VERSION="%s"\n' % version,
+ startswith=True,
+ dryrun=options.dryrun)
+ find_and_replace('solaris-ips/pkginfo.bcfg2-server', 'VERSION=',
+ 'VERSION="%s"\n' % version,
+ startswith=True,
+ dryrun=options.dryrun)
# set new version in Bcfg2/version.py
find_and_replace('src/lib/Bcfg2/version.py',
'__version__ =',
@@ -249,30 +273,30 @@ E.G. 1.2.0pre1 is a valid version.
else:
find_and_replace('misc/bcfg2.spec', 'Release: ',
'Release: 0.%s.%s\n' %
- (version_info['build'][-1], version_info['build']),
+ (version_info['build'][-1], version_info['build']),
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
'Release: 0.%s.%s\n' %
- (version_info['build'][-1], version_info['build']),
+ (version_info['build'][-1], version_info['build']),
dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', '%setup',
'%%setup -q -n %%{name}-%%{version}%s\n' %
- version_info['build'],
+ version_info['build'],
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', '%setup',
'%%setup -q -n %%{name}-%%{version}%s\n' %
- version_info['build'],
+ version_info['build'],
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', 'BuildRoot',
'BuildRoot: %%{_tmppath}/%%{name}-%%{version}%s-%%{release}-root-%%(%%{__id_u} -n)\n' %
- version_info['build'],
+ version_info['build'],
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', 'BuildRoot',
'BuildRoot: %%{_tmppath}/%%{name}-%%{version}%s-%%{release}-root-%%(%%{__id_u} -n)\n' %
- version_info['build'],
+ version_info['build'],
startswith=True,
dryrun=options.dryrun)
# fix pre problem noted in