Projet

Général

Profil

Révision 1e717d89

ID1e717d8901eb2ede7034a8195fa5eb9b781c3363
Parent 23811e34
Enfant 6b42464c

Ajouté par Lars Kruse il y a plus de 7 ans

Plugin swift-dispersion: fix style issues

Voir les différences:

plugins/swift/swift-dispersion
27 27

  
28 28
try:
29 29
    if sys.argv[1] == "config":
30
        print 'graph_title Swift cluster dispersion'
31
        print 'graph_category fs'
30
        print('graph_title Swift cluster dispersion')
31
        print('graph_category fs')
32 32

  
33
        print 'object_missing_two.type GAUGE'
34
        print 'object_missing_two.label Objects missing two copies'
35
        print 'object_retries.type GAUGE'
36
        print 'object_retries.label Objects retries'
37
        print 'object_copies_expected.type GAUGE'
38
        print 'object_copies_expected.label Objects copies expected'
39
        print 'object_missing_one.type GAUGE'
40
        print 'object_missing_one.label Objects missing one copy'
41
        print 'object_copies_found.type GAUGE'
42
        print 'object_copies_found.label Objects copies found'
43
        print 'object_missing_all.type GAUGE'
44
        print 'object_missing_all.label Objects missing all copies'
45
        print 'object_overlapping.type GAUGE'
46
        print 'object_overlapping.label Objects overlapping partitions'
33
        print('object_missing_two.type GAUGE')
34
        print('object_missing_two.label Objects missing two copies')
35
        print('object_retries.type GAUGE')
36
        print('object_retries.label Objects retries')
37
        print('object_copies_expected.type GAUGE')
38
        print('object_copies_expected.label Objects copies expected')
39
        print('object_missing_one.type GAUGE')
40
        print('object_missing_one.label Objects missing one copy')
41
        print('object_copies_found.type GAUGE')
42
        print('object_copies_found.label Objects copies found')
43
        print('object_missing_all.type GAUGE')
44
        print('object_missing_all.label Objects missing all copies')
45
        print('object_overlapping.type GAUGE')
46
        print('object_overlapping.label Objects overlapping partitions')
47 47

  
48
        print 'container_missing_two.type GAUGE'
49
        print 'container_missing_two.label Containers missing two copies'
50
        print 'container_retries.type GAUGE'
51
        print 'container_retries.label Containers retries'
52
        print 'container_copies_expected.type GAUGE'
53
        print 'container_copies_expected.label Containers copies expected'
54
        print 'container_missing_one.type GAUGE'
55
        print 'container_missing_one.label Containers missing one copy'
56
        print 'container_copies_found.type GAUGE'
57
        print 'container_copies_found.label Containers copies found'
58
        print 'container_missing_all.type GAUGE'
59
        print 'container_missing_all.label Containers missing all copies'
60
        print 'container_overlapping.type GAUGE'
61
        print 'container_overlapping.label Containers overlapping paritions'
48
        print('container_missing_two.type GAUGE')
49
        print('container_missing_two.label Containers missing two copies')
50
        print('container_retries.type GAUGE')
51
        print('container_retries.label Containers retries')
52
        print('container_copies_expected.type GAUGE')
53
        print('container_copies_expected.label Containers copies expected')
54
        print('container_missing_one.type GAUGE')
55
        print('container_missing_one.label Containers missing one copy')
56
        print('container_copies_found.type GAUGE')
57
        print('container_copies_found.label Containers copies found')
58
        print('container_missing_all.type GAUGE')
59
        print('container_missing_all.label Containers missing all copies')
60
        print('container_overlapping.type GAUGE')
61
        print('container_overlapping.label Containers overlapping paritions')
62 62
    sys.exit(0)
63 63
except IndexError:
64 64
    pass
65 65

  
66
with os.popen("swift-dispersion-report -j %s" \
67
                  % os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/dispersion.conf")) as report:
66
with os.popen("swift-dispersion-report -j %s"
67
              % os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/dispersion.conf")) as report:
68 68
    stats = json.load(report)
69 69

  
70 70
for type_, values in stats.iteritems():
71 71
    for key, value in values.iteritems():
72
        print "%s_%s.value %d" % (type_, key, value)
72
        print("%s_%s.value %d" % (type_, key, value))

Formats disponibles : Unified diff