Skip to content

Commit 49b4e1b

Browse files
authored
Merge pull request #37 from SumoLogic/printfixpython3
Printfixpython3
2 parents 4731bad + 1f8bb93 commit 49b4e1b

13 files changed

Lines changed: 32 additions & 31 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ nosetests.xml
3434
.mr.developer.cfg
3535
.project
3636
.pydevproject
37+
.idea/

scripts/bulk-set.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@
1919

2020
for c in cs:
2121
if 'category' not in c or 'bwe' not in c['category'] and 'bwm' not in c['category']:
22-
print 'collector: ' + c['name']
22+
print('collector: ' + c['name'])
2323
ss = sumo.sources(c['id'])
2424
time.sleep(delay)
2525
for s in ss:
2626
sv, etag = sumo.source(c['id'], s['id'])
2727
time.sleep(delay)
2828
svi = sv['source']
2929
if 'category' not in svi or 'bwe' not in svi['category'] and 'bwm' not in svi['category']:
30-
print 'source: ' + svi['name']
30+
print('source: ' + svi['name'])
3131
svi['filters'] = f
3232
r = sumo.update_source(c['id'], sv, etag)
33-
print r
34-
print r.text
33+
print(r)
34+
print(r.text)
3535
time.sleep(delay)
3636
#if svi['forceTimeZone'] == False:
3737
# svi['forceTimeZone'] = True
3838
# svi[u'timeZone'] = u'UTC'
3939
# r = sumo.update_source(c['id'], sv, etag)
40-
# print str(r) + ': ' + str(r.text)
40+
# print(str(r) + ': ' + str(r.text))
4141
# time.sleep(delay)

scripts/create-source.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
cs = sumo.collectors()
1515

1616
for c in cs:
17-
print c
18-
print field, string
17+
print(c)
18+
print(field, string)
1919
if field in c and string in c[field]:
20-
print sumo.create_source(c['id'],source)
20+
print(sumo.create_source(c['id'],source))

scripts/get-collectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
for c in cs:
1515
if field in c and string in c[field]:
16-
print c
16+
print(c)

scripts/get-dashboard-data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
args = sys.argv
1010
sumo = SumoLogic(args[1], args[2], args[3])
1111
ds = sumo.dashboards(True)
12-
print ds
12+
print(ds)
1313

1414
#for d in ds:
15-
# print d
15+
# print(d)

scripts/get-sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
for c in cs:
1515
if field in c and string in c[field]:
16-
print sumo.sources(c['id'])
16+
print(sumo.sources(c['id']))

scripts/mv-cat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
if 'category' in c and c['category'] == fromCat:
1919
cv, etag = sumo.collector(c['id'])
2020
cv['collector']['category'] = toCat
21-
print sumo.update_collector(cv, etag).text
21+
print(sumo.update_collector(cv, etag).text)
2222
ss = sumo.sources(c['id'])
2323
for s in ss:
2424
if s['category'] == fromCat:
2525
sv, etag = sumo.source(c['id'], s['id'])
2626
sv['source']['category'] = toCat
27-
print sumo.update_source(c['id'], sv, etag).text
27+
print(sumo.update_source(c['id'], sv, etag).text)

scripts/mv-parse.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232

3333
for c in cs:
3434
if c['type'] == 'Search':
35-
print 'before: ' + c['searchQuery'] + '\n'
35+
print('before: ' + c['searchQuery'] + '\n')
3636
c['searchQuery'] = string.replace(c['searchQuery'], from_expr, to_expr, 1)
37-
print 'after: ' + c['searchQuery'] + '\n'
37+
print('after: ' + c['searchQuery'] + '\n')
3838
elif c['type'] == 'Dashboard':
3939
for col in c['columns']:
4040
for m in col['monitors']:
41-
print 'before: ' + m['searchQuery'] + '\n'
41+
print('before: ' + m['searchQuery'] + '\n')
4242
m['searchQuery'] = string.replace(m['searchQuery'], from_expr, to_expr, 1)
43-
print 'after: ' + m['searchQuery'] + '\n'
44-
print sumo.create_contents(string.strip(path, '/').split('/')[0], cs)
43+
print('after: ' + m['searchQuery'] + '\n')
44+
print(sumo.create_contents(string.strip(path, '/').split('/')[0], cs))
4545

scripts/rm-collectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
for c in cs:
1515
if field in c and string in c[field]:
1616
cv, _ = sumo.collector(c['id'])
17-
print sumo.delete_collector(cv).text
17+
print(sumo.delete_collector(cv).text)

scripts/rm-src-by-cat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
for s in ss:
1717
if s['category'] == cat:
1818
sv, _ = sumo.source(c['id'], s['id'])
19-
print sumo.delete_source(c['id'], sv).text
19+
print(sumo.delete_source(c['id'], sv).text)

0 commit comments

Comments
 (0)