Skip to content

Commit

Permalink
Make prints Python 3 compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
okin committed Oct 1, 2018
1 parent 4f4a258 commit 936f467
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions katprep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
katprep toolkit.
"""

from __future__ import absolute_import
from __future__ import absolute_import, print_function

import getpass
import logging
Expand Down Expand Up @@ -194,7 +194,7 @@ def validate_filters(options, api_client):
options.environment = api_client.get_id_by_name(
options.environment, "environment")
except Exception as err:
print err
print(err)
except SessionException:
pass

Expand Down
7 changes: 3 additions & 4 deletions katprep/authconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
A script which maintains entries in a authentication container.
"""

from __future__ import absolute_import
from __future__ import absolute_import, print_function

import argparse
import logging
Expand Down Expand Up @@ -39,10 +39,9 @@ def list_entries(options):
password = credentials[1]
else:
password = "xxx"
#print entry
print "{} (Username: {} / Password: {})".format(
print("{} (Username: {} / Password: {})".format(
hostname, credentials[0], password
)
))



Expand Down
8 changes: 5 additions & 3 deletions katprep/clients/LibvirtClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Class for sending requests to libvirt
"""

from __future__ import print_function

import libvirt
import logging
from katprep.clients import SessionException, EmptySetException, \
Expand Down Expand Up @@ -275,7 +277,7 @@ def get_vm_hosts(self):
Returns a list of VMs and their hypervisors available through the
current connection.
"""
print "TODO: get_vm_hosts"
print("TODO: get_vm_hosts")



Expand Down Expand Up @@ -315,7 +317,7 @@ def powerstate_vm(self, vm_name):
:type vm_name: str
"""
print "TODO: powerstate_vm"
print("TODO: powerstate_vm")



Expand All @@ -331,7 +333,7 @@ def __manage_power(
:type action: str
"""
print "TODO: manage_power"
print("TODO: manage_power")



Expand Down
4 changes: 2 additions & 2 deletions katprep/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
managed with Foreman/Katello or Red Hat Satellite 6.
"""

from __future__ import absolute_import
from __future__ import absolute_import, print_function

import argparse
import logging
Expand Down Expand Up @@ -568,7 +568,7 @@ def load_configuration(config_file, options):
with open(config_file, 'r') as yml_file:
config = yaml.load(yml_file)
#TODO: load configuration
print "TODO: load_configuration"
print("TODO: load_configuration")
except ValueError as err:
LOGGER.debug("Error: '%s'", err)
return options
Expand Down
2 changes: 1 addition & 1 deletion tests/test_LibvirtClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Unit tests for Libvirt integration
"""

from __future__ import absolute_import
from __future__ import absolute_import, print_function

import logging
import pytest
Expand Down

0 comments on commit 936f467

Please sign in to comment.