summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-22 10:51:58 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-22 10:51:58 -0400
commitb147ac47c4820737d112ad7ce7047e31ef68f732 (patch)
tree85e2e27c8933a32fdac5219184d5392b3b1c13ee /src
parenta400a860abe7c373c43a7df3fb55affd9746b292 (diff)
downloadbcfg2-b147ac47c4820737d112ad7ce7047e31ef68f732.tar.gz
bcfg2-b147ac47c4820737d112ad7ce7047e31ef68f732.tar.bz2
bcfg2-b147ac47c4820737d112ad7ce7047e31ef68f732.zip
added -f flag to bcfg2-info buildall
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg2-info22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index 70e327ef3..1f41ba6b8 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -259,15 +259,23 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core):
self.help_builddir()
def do_buildall(self, args):
- if len(args.split()) != 1:
- print("Usage: buildall <directory>")
+ alist = args.split()
+ for arg in alist:
+ if arg == '-f':
+ alist.remove('-f')
+ flags = [arg]
+ if len(alist) != 1:
+ print("Usage: buildall [-f] <directory>")
return
- try:
- os.mkdir(args)
- except:
- pass
+ if not os.path.exists(alist[0]):
+ try:
+ os.mkdir(alist[0])
+ except OSError:
+ err = sys.exc_info()[1]
+ logger.error("Could not create %s: %s" % (alist[0], err))
for client in self.metadata.clients:
- self.do_build("%s %s/%s.xml" % (client, args, client))
+ self.do_build("%s %s %s/%s.xml" % (" ".join(flags),
+ client, args, client))
def do_buildfile(self, args):
"""Build a config file for client."""