summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-30 10:24:12 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-30 10:24:12 -0400
commit8b438fda3ae2d9516dbfb6014c280b68036c17e1 (patch)
treeb8acb22b313e4b57797a227b42f69b95b54bd976 /src/sbin
parent7a008a0b1b4d3b819da5a6544ac15faab3cbb28a (diff)
downloadbcfg2-8b438fda3ae2d9516dbfb6014c280b68036c17e1.tar.gz
bcfg2-8b438fda3ae2d9516dbfb6014c280b68036c17e1.tar.bz2
bcfg2-8b438fda3ae2d9516dbfb6014c280b68036c17e1.zip
Metadata and other improvements:
* Added support for Client tag in groups.xml * Added support for nested Group tags in groups.xml * Added support for negated groups in groups.xml * Added DatabaseBacked plugin mixin to easily allow plugins to connect to a database specified in global database settings in bcfg2.conf * Added DBMetadata plugin that uses relational DB to store client records instead of writing to clients.xml
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-info13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index 8754fb066..28f4d17ac 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -102,7 +102,7 @@ def getClientList(hostglobs):
""" given a host glob, get a list of clients that match it """
# special cases to speed things up:
if '*' in hostglobs:
- return list(self.metadata.clients.keys())
+ return self.metadata.clients
has_wildcards = False
for glob in hostglobs:
# check if any wildcard characters are in the string
@@ -113,7 +113,7 @@ def getClientList(hostglobs):
return hostglobs
rv = set()
- clist = set(self.metadata.clients.keys())
+ clist = set(self.metadata.clients)
for glob in hostglobs:
for client in clist:
if fnmatch.fnmatch(client, glob):
@@ -328,7 +328,7 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
if len(alist) > 1:
clients = getClientList(alist[1:])
else:
- clients = list(self.metadata.clients.keys())
+ clients = self.metadata.clients
for client in clients:
self.do_build("%s %s" % (client, os.path.join(destdir,
client + ".xml")))
@@ -360,7 +360,7 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
if len(args) > 2:
clients = getClientList(args[1:])
else:
- clients = list(self.metadata.clients.keys())
+ clients = self.metadata.clients
if altsrc:
args = "--altsrc %s -f %%s %%s %%s" % altsrc
else:
@@ -448,10 +448,11 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
def do_clients(self, _):
"""Print out client info."""
data = [('Client', 'Profile')]
- clist = list(self.metadata.clients.keys())
+ clist = self.metadata.clients
clist.sort()
for client in clist:
- data.append((client, self.metadata.clients[client]))
+ imd = self.metadata.get_initial_metadata(client)
+ data.append((client, imd.profile))
printTabular(data)
def do_config(self, _):