~ubuntu-branches/ubuntu/hardy/bcfg2/hardy-updates

« back to all changes in this revision

Viewing changes to src/lib/Server/Metadata.py

  • Committer: Bazaar Package Importer
  • Author(s): Sami Haahtinen
  • Date: 2006-11-16 22:39:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061116223916-8dtn3t86cz58vg2x
Tags: 0.8.6.1-1
* New Upstream Release
* Replaced faulty if clause in bcfg2.postrm (Closes: #398772)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
'''This file stores persistent metadata for the BCFG Configuration Repository'''
2
 
__revision__ = '$Revision: 2249 $'
 
2
__revision__ = '$Revision: 2308 $'
3
3
 
4
4
import logging, lxml.etree, os, socket, time
5
5
 
22
22
 
23
23
class Metadata:
24
24
    '''This class contains data for bcfg2 server metadata'''
25
 
    __version__ = '$Id: Metadata.py 2249 2006-09-14 13:07:38Z desai $'
 
25
    __version__ = '$Id: Metadata.py 2308 2006-09-24 23:17:10Z desai $'
26
26
    __author__ = 'bcfg-dev@mcs.anl.gov'
27
27
 
28
28
    def __init__(self, fam, datastore):
191
191
        toolset = toolinfo[0]
192
192
        return ClientMetadata(client, groups, bundles, toolset, categories)
193
193
        
194
 
    def ping_sweep_clients(self):
195
 
        '''Find live and dead clients'''
196
 
        live = {}
197
 
        dead = {}
198
 
        work = self.clients.keys()
199
 
        while work:
200
 
            client = work.pop()
201
 
            rc = os.system("/bin/ping -w 5 -c 1 %s > /dev/null 2>&1" % client)
202
 
            if not rc:
203
 
                live[client] = time.time()
204
 
            else:
205
 
                dead[client] = time.time()
206