summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-reports
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-12-21 22:52:34 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-12-21 22:52:34 +0000
commit5ab6c7a56e1cb16fee6b04a2b74e615f8f4c557e (patch)
tree59b439130933085c8b76ef696921b3d4a7df0304 /src/sbin/bcfg2-reports
parent1a2fbced68eaf6bb01d6dee6a4223c7368095137 (diff)
downloadbcfg2-5ab6c7a56e1cb16fee6b04a2b74e615f8f4c557e.tar.gz
bcfg2-5ab6c7a56e1cb16fee6b04a2b74e615f8f4c557e.tar.bz2
bcfg2-5ab6c7a56e1cb16fee6b04a2b74e615f8f4c557e.zip
Add option to view stale hosts in bcfg2-reports
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4998 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-reports')
-rwxr-xr-xsrc/sbin/bcfg2-reports21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/sbin/bcfg2-reports b/src/sbin/bcfg2-reports
index af3cf96fb..16b9cd11e 100755
--- a/src/sbin/bcfg2-reports
+++ b/src/sbin/bcfg2-reports
@@ -112,7 +112,7 @@ entrydict = dict()
args = sys.argv[1:]
opts, pargs = getopt(args, 'ab:cde:hs:x:',
- ['sort=', 'fields=', 'badentry=', 'extraentry='])
+ ['stale', 'sort=', 'fields=', 'badentry=', 'extraentry='])
for option in opts:
if len(option) > 0:
@@ -141,7 +141,8 @@ if expire != "":
c_inst.save()
elif '-h' in args:
- print '''usage: python bcfg2-reports [option] ...
+ print """Usage: python bcfg2-reports [option] ...
+
Options and arguments (and corresponding environment variables):
-a : shows all hosts, including expired hosts
-b NAME : single-host mode - shows bad entries from the
@@ -164,7 +165,9 @@ Options and arguments (and corresponding environment variables):
read from a file of name ARG1
--fields=ARG1,ARG2,... : only displays the fields ARG1,ARG2,...
(name,time,state)
---sort=ARG1,ARG2,... : sorts output on ARG1,ARG2,... (name,time,state)'''
+--sort=ARG1,ARG2,... : sorts output on ARG1,ARG2,... (name,time,state)
+--stale : shows hosts which haven't run in the last 24 hours
+"""
elif singlehost != "":
for c_inst in c_list:
if singlehost == c_inst.name:
@@ -202,12 +205,18 @@ else:
if extraentry != "":
extraentry = extraentry.split(',')
-
- if '-c' in args:
+
+ # stale hosts
+ if '--stale' in args:
+ for c_inst in c_list:
+ if c_inst.current_interaction.isstale():
+ result.append(c_inst)
+ # clean hosts
+ elif '-c' in args:
for c_inst in c_list:
if c_inst.current_interaction.isclean():
result.append(c_inst)
-
+ # dirty hosts
elif '-d' in args:
for c_inst in c_list:
if not c_inst.current_interaction.isclean():