Skip to content

Commit

Permalink
Python 3.x compatibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Jan 26, 2015
1 parent 0a70eae commit 5624c14
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/vpoller-client
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ discovering and polling of vSphere Object properties.
"""

from __future__ import print_function

import logging

from vpoller import __version__
Expand Down Expand Up @@ -103,7 +105,7 @@ Examples:

data = client.run(msg)

print data
print('{}'.format(data))

if __name__ == '__main__':
main()
8 changes: 5 additions & 3 deletions src/vpoller-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ between a pool of ZeroMQ workers.
"""

from __future__ import print_function

import os
import logging

Expand Down Expand Up @@ -60,7 +62,7 @@ def stop(endpoint):
client = VPollerClient(endpoint=endpoint, timeout=1000, retries=3)
result = client.run({'method': 'shutdown'})

print result
print('{}'.format(result))

def status(endpoint):
"""
Expand All @@ -73,7 +75,7 @@ def status(endpoint):
client = VPollerClient(endpoint=endpoint, timeout=1000, retries=3)
result = client.run({'method': 'status'})

print result
print('{}'.format(result))

def main():

Expand Down Expand Up @@ -102,7 +104,7 @@ Options:
args = docopt(usage, version=__version__)

if not os.path.exists(args['--file']):
raise SystemExit, 'Configuration file %s does not exist'
raise SystemExit('Configuration file {} does not exist'.format(args['--file']))

level = logging.DEBUG if args['--debug'] else logging.INFO
logging.basicConfig(
Expand Down
8 changes: 5 additions & 3 deletions src/vpoller-worker
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ performing the actual polling from a vCenter server.
"""

from __future__ import print_function

import os
import logging

Expand Down Expand Up @@ -70,7 +72,7 @@ def stop(endpoint):
client = VPollerClient(endpoint=endpoint, timeout=1000, retries=3)
result = client.run({'method': 'shutdown'})

print result
print('{}'.format(result))

def status(endpoint):
"""
Expand All @@ -83,7 +85,7 @@ def status(endpoint):
client = VPollerClient(endpoint=endpoint, timeout=1000, retries=3)
result = client.run({'method': 'status'})

print result
print('{}'.format(result))

def main():
usage="""
Expand Down Expand Up @@ -114,7 +116,7 @@ Options:
args = docopt(usage, version=__version__)

if not os.path.exists(args['--file']):
raise SystemExit, 'Configuration file %s does not exist' % args['--file']
raise SystemExit('Configuration file {} does not exist'.format(args['--file']))

level = logging.DEBUG if args['--debug'] else logging.INFO
logging.basicConfig(
Expand Down

0 comments on commit 5624c14

Please sign in to comment.