Skip to content

Instantly share code, notes, and snippets.

View stpierre's full-sized avatar

Chris St. Pierre stpierre

  • Petal Card, Inc.
  • Lincoln, NE
View GitHub Profile
diff --git a/src/lib/Server/Plugins/Packages/Collection.py b/src/lib/Server/Plugins/Packages/Collection.py
index aed85fe..ab87257 100644
--- a/src/lib/Server/Plugins/Packages/Collection.py
+++ b/src/lib/Server/Plugins/Packages/Collection.py
@@ -124,8 +124,7 @@ class Collection(object):
def setup_data(self, force_update=False):
""" do any collection-level data setup tasks """
- for source in self.sources:
- source.setup_data(force_update)
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -1,9 +1,6 @@
"""All POSIX Type client support for Bcfg2."""
__revision__ = '$Revision$'
-from stat import S_ISVTX, S_ISGID, S_ISUID, S_IXUSR, S_IWUSR, S_IRUSR, S_IXGRP
-from stat import S_IWGRP, S_IRGRP, S_IXOTH, S_IWOTH, S_IROTH, ST_MODE, S_ISDIR
-from stat import S_IFREG, ST_UID, ST_GID, S_ISREG, S_IFDIR, S_ISLNK, ST_MTIME
import binascii
diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py
index 5206ecc..acc84a4 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -214,6 +214,7 @@ class YUMng(Bcfg2.Client.Tools.PkgTool):
except AttributeError:
self.yb._getConfig(self.yb.conf.config_file_path,
debuglevel=debuglevel)
+ print "debuglevel = %s" % self.yb.conf.debuglevel
A new release for Bcfg2 1.2.1 is now available at:
ftp://ftp.mcs.anl.gov/pub/bcfg
Bcfg2 1.2.1 is primarily a bugfix release, with over 2 dozen reported
bugs and dozens more unreported bugs fixed. The only significant
change from 1.2.0 is that regular expression support in Rules is now
optional, and off by default; see
http://docs.bcfg2.org/server/plugins/generators/rules.html#using-regular-expressions-in-rules
for more details.
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index f423bea..9fe8c2b 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -1199,27 +1199,32 @@ class SimpleConfig(FileBacked,
self.remove_section(section)
self.read(self.name)
- def get(self, section, option, default=None):
+ def get(self, section, option, **kwargs):
diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec
index 191bfaf..301cdfd 100644
--- a/misc/bcfg2.spec
+++ b/misc/bcfg2.spec
@@ -268,6 +268,10 @@ mv build/dtd %{buildroot}%{_defaultdocdir}/bcfg2-doc-%{version}/
%{__mkdir_p} %{buildroot}%{_localstatedir}/cache/bcfg2
+# mandriva and RHEL 5 cannot handle %ghost without the file existing,
+# so let's touch a bunch of empty config files
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index cc6cf13..db85c2e 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -141,7 +141,7 @@ class BaseCore(object):
self.logger.error("Failed to update database schema: %s" % err)
except ImportError:
# assume django is not installed
- pass
+ raise
@stpierre
stpierre / gist:4088324
Created November 16, 2012 15:42
Python FizzBuzz
for n in range(1, 101):
output = []
if n % 3 == 0:
output.append("Fizz")
if n % 5 == 0:
output.append("Buzz")
if not output:
print(str(n))
else:
print("".join(output))
@stpierre
stpierre / gist:ec64422d3713c1a6149a
Created May 7, 2015 12:37
Bash comparison operators
$ a=4
$ b=04
$ test "$a" -eq "$b"
$ echo $?
0
$ test "$a" = "$b"
$ echo $?
1
MariaDB [merit_scratch]> CREATE TABLE `MERIT_BADGE` (
-> `BadgeID` INT(11) UNSIGNED AUTO_INCREMENT,
-> `BadgeName` VARCHAR(256) NOT NULL,
-> `AlternateGroupID` INT(11) UNSIGNED,
-> PRIMARY KEY (`BadgeID`));
Query OK, 0 rows affected (0.01 sec)
MariaDB [merit_scratch]> CREATE TABLE `ALTERNATE_GROUPS` (
-> `AlternateGroupID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
-> PRIMARY KEY (`AlternateGroupID`));