diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-11-30 01:42:33 +0100 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-11-30 04:03:40 +0100 |
commit | f0dc2741112efb2dbe741db6ff5b842251eae0d7 (patch) | |
tree | 9d029dd0abb3a47434bdb460fc00eb72017c28b5 /all-clients | |
parent | 0a20f036fd20830eee3a40380b0e87cabc86a0d5 (diff) | |
download | bcfg2-tools-f0dc2741112efb2dbe741db6ff5b842251eae0d7.tar.gz bcfg2-tools-f0dc2741112efb2dbe741db6ff5b842251eae0d7.tar.bz2 bcfg2-tools-f0dc2741112efb2dbe741db6ff5b842251eae0d7.zip |
all-clients: reimplement in python
The new implementation asks the server about the client list.
Diffstat (limited to 'all-clients')
-rwxr-xr-x | all-clients | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/all-clients b/all-clients index 1bdbee7..f904c61 100755 --- a/all-clients +++ b/all-clients @@ -1,3 +1,12 @@ -#!/bin/sh +#!/usr/bin/python +import Bcfg2.Options +import Bcfg2.Client.Proxy -sqlite3 /var/lib/bcfg2/etc/bcfg2.sqlite 'SELECT hostname from Server_metadataclientmodel' +parser = Bcfg2.Options.get_parser( + components=[Bcfg2.Client.Proxy.ComponentProxy]) +parser.parse() + +proxy = Bcfg2.Client.Proxy.ComponentProxy() +clients = getattr(proxy, 'Metadata.list_clients')() +for client in clients: + print client |