summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--misc/bcfg2.spec13
-rw-r--r--src/lib/Bcfg2/Server/Admin.py14
-rw-r--r--src/lib/Bcfg2/Server/Core.py2
-rw-r--r--src/lib/Bcfg2/Server/FileMonitor/Inotify.py1
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Bundler.py2
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py4
6 files changed, 28 insertions, 8 deletions
diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec
index 357afed4e..4b6da2441 100644
--- a/misc/bcfg2.spec
+++ b/misc/bcfg2.spec
@@ -18,11 +18,11 @@
# characters from the appropriate line below.
#
# Don't forget to change the Release: tag below to something like 0.1
-#%%global _rc 1
-%global _pre pre1
+#%%global _rc rc1
+#%%global _pre pre1
%global _nightly 1
%global _date %(date +%Y%m%d)
-%global _pre_rc %{?_pre:pre%{_pre}}%{?_rc:rc%{_rc}}
+%global _pre_rc %{?_pre:%{_pre}}%{?_rc:%{_rc}}
# cherrypy 3.3 actually doesn't exist yet, but 3.2 has bugs that
# prevent it from working:
@@ -56,6 +56,8 @@ BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-lxml
BuildRequires: python-boto
+BuildRequires: python-argparse
+BuildRequires: python-jinja2
%if 0%{?suse_version}
BuildRequires: python-M2Crypto
BuildRequires: python-Genshi
@@ -137,6 +139,8 @@ BuildRequires: systemd-units
Requires: python-ssl
%endif
Requires: libselinux-python
+Requires: pylibacl
+Requires: python-argparse
%if 0%{?fedora} >= 16
Requires(post): systemd-units
@@ -192,6 +196,7 @@ Group: System Environment/Daemons
%endif
Requires: bcfg2 = %{version}-%{release}
Requires: python-lxml >= 1.2.1
+Requires: python-genshi
%if 0%{?suse_version}
Requires: python-pyinotify
Requires: python-python-daemon
@@ -714,7 +719,9 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \
%{python_sitelib}/Bcfg2/Server
%{python_sitelib}/Bcfg2/Reporting
%{python_sitelib}/Bcfg2/manage.py*
+%if %{build_cherry_py}
%exclude %{python_sitelib}/Bcfg2/Server/CherryPyCore.py*
+%endif
%dir %{_datadir}/bcfg2
%{_datadir}/bcfg2/schemas
diff --git a/src/lib/Bcfg2/Server/Admin.py b/src/lib/Bcfg2/Server/Admin.py
index 6bb973173..b038980a1 100644
--- a/src/lib/Bcfg2/Server/Admin.py
+++ b/src/lib/Bcfg2/Server/Admin.py
@@ -881,6 +881,7 @@ if HAS_DJANGO:
Django management system """
command = None
args = []
+ kwargs = {}
def run(self, _):
'''Call a django command'''
@@ -889,7 +890,7 @@ if HAS_DJANGO:
else:
command = self.__class__.__name__.lower()
args = [command] + self.args
- management.call_command(*args)
+ management.call_command(*args, **self.kwargs)
class DBShell(_DjangoProxyCmd):
""" Call the Django 'dbshell' command on the database """
@@ -918,6 +919,17 @@ if HAS_DJANGO:
self.logger.error("Database update failed: %s" % err)
raise SystemExit(1)
+ if django.VERSION[0] == 1 and django.VERSION[1] >= 7:
+ class Makemigrations(_DjangoProxyCmd):
+ """ Call the 'makemigrations' command on the database """
+ args = ['Reporting']
+
+ else:
+ class Schemamigration(_DjangoProxyCmd):
+ """ Call the South 'schemamigration' command on the database """
+ args = ['Bcfg2.Reporting']
+ kwargs = {'auto': True}
+
if HAS_REPORTS:
import datetime
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index 87bbe7e1b..a9628c024 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -684,7 +684,7 @@ class Core(object):
self.logger.debug("Building configuration for %s" % client)
start = time.time()
config = lxml.etree.Element("Configuration", version='2.0',
- revision=self.revision)
+ revision=str(self.revision))
try:
meta = self.build_metadata(client)
except MetadataConsistencyError:
diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py
index c4b34a469..8f6e136fd 100644
--- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py
+++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py
@@ -214,6 +214,7 @@ class Inotify(Pseudo, pyinotify.ProcessEvent):
def shutdown(self):
if self.started and self.notifier:
self.notifier.stop()
+ Pseudo.shutdown(self)
shutdown.__doc__ = Pseudo.shutdown.__doc__
def list_watches(self):
diff --git a/src/lib/Bcfg2/Server/Plugins/Bundler.py b/src/lib/Bcfg2/Server/Plugins/Bundler.py
index 6c35ada59..f5bcbe797 100644
--- a/src/lib/Bcfg2/Server/Plugins/Bundler.py
+++ b/src/lib/Bcfg2/Server/Plugins/Bundler.py
@@ -128,7 +128,7 @@ class Bundler(Plugin,
# dependent bundle -- add it to the list of
# bundles for this client
if child.get("name") not in bundles_added:
- bundles.append(child.get("name"))
+ bundles.add(child.get("name"))
bundles_added.add(child.get("name"))
if child.get('inherit_modification', 'false') == 'true':
if metadata.version_info >= \
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py
index 1bf208c3e..5a8c44cd5 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py
@@ -98,7 +98,7 @@ class TestBundler(TestPlugin, TestStructure, TestXMLDirectoryBacked):
lxml.etree.SubElement(expected['indep'], "Service", name="baz")
metadata = Mock()
- metadata.bundles = ["error", "xinclude", "has_dep", "indep"]
+ metadata.bundles = set(["error", "xinclude", "has_dep", "indep"])
metadata.version_info = Bcfg2VersionInfo('1.4.0')
rv = b.BuildStructures(metadata)
@@ -131,7 +131,7 @@ class TestBundler(TestPlugin, TestStructure, TestXMLDirectoryBacked):
lxml.etree.SubElement(expected['has_dep'], "Package", name="foo")
metadata = Mock()
- metadata.bundles = ["has_dep"]
+ metadata.bundles = set(["has_dep"])
metadata.version_info = Bcfg2VersionInfo('1.3.0')
rv = b.BuildStructures(metadata)