From f0dc2741112efb2dbe741db6ff5b842251eae0d7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 30 Nov 2014 01:42:33 +0100 Subject: all-clients: reimplement in python The new implementation asks the server about the client list. --- all-clients | 13 +++++++++++-- 1 file 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 -- cgit v1.2.3-1-g7c22