dbrtools/dbr/checkenv.py
changeset 212 21d5b62bbd8e
parent 205 213f75c7878c
child 242 9fd4819bf104
equal deleted inserted replaced
211:fc3107523c38 212:21d5b62bbd8e
    15 
    15 
    16 import dbrenv
    16 import dbrenv
    17 
    17 
    18 def run(args):
    18 def run(args):
    19   location = '/'
    19   location = '/'
    20 #needs a fix to scanenv for this to work...  
    20   filtertype = ''
    21 #  if(len(args)):
    21 #using arg for filter...not for other env  
    22 #    location = args[0]
    22   if(len(args)):
       
    23     filtertype = args[0]
    23   db = dbrenv.CreateDB(location)
    24   db = dbrenv.CreateDB(location)
    24   local = dbrenv.DBRLocalEnv(location)
    25   local = dbrenv.DBRLocalEnv(location)
    25   results = db.compare(local)
    26   results = db.compare(local)
    26   local.verify(results.unknown)
    27   local.verify(results.unknown)
    27   results2 = db.compare(local)
    28   results2 = db.compare(local)
    28   results2.printdetail()
    29   filter = dbrenv.CreateFilter(filtertype)
    29   results2.printsummary()
    30   filteredresults = filter.filter(results2)
       
    31   filteredresults.printdetail()
       
    32   filteredresults.printsummary()
    30   db.update(local, results2.touched)
    33   db.update(local, results2.touched)
    31   db.save()
    34   db.save()
    32     
    35     
    33 def help():
    36 def help():
    34   print "Checks the status of the current environment"
    37   print "Checks the status of the current environment"