1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 from config_common.rhn_log import log_debug, die
17
18 import handler_base
19 import sys
20
21 -class Handler(handler_base.HandlerBase):
23 log_debug(2)
24 r = self.repository
25
26 files = r.list_files()
27
28 if not files:
29 die(1, "No managed files.")
30
31 label = "Config Channel"
32 maxlen = max([len(s[0]) for s in files])
33 maxlen = max(maxlen, len(label)) + 2
34
35 print("DoFoS %*s %s" % (maxlen, label, "File"))
36 arg_files = []
37 if len(sys.argv) > 2:
38 arg_files = sys.argv[2:len(sys.argv)]
39
40 for file in files:
41
42 if len(arg_files) and not file[1] in arg_files:
43 continue
44
45
46
47 if (len(file) < 3) or file[2] == 1:
48 print("F %*s %s" % (maxlen, file[0], file[1]))
49 elif file[2] == 2 :
50
51 print("D %*s %s" % (maxlen, file[0], file[1]))
52 else:
53 print("S %*s %s" % (maxlen, file[0], file[1]))
54