diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-12-21 13:06:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-21 13:06:27 -0500 |
commit | 4c20c6b76f295dc83e2ce730238b7753724e7e53 (patch) | |
tree | 4e6ff6855c6e5343e97d0864f47cb2088fe364f9 /roles/kube_nfs_volumes | |
parent | 3e5f3380ccacc654450924fca830b93fda6c7592 (diff) | |
parent | 7d02b608de839cb57e2071e9d55052957c13aae3 (diff) | |
download | openshift-4c20c6b76f295dc83e2ce730238b7753724e7e53.tar.gz openshift-4c20c6b76f295dc83e2ce730238b7753724e7e53.tar.bz2 openshift-4c20c6b76f295dc83e2ce730238b7753724e7e53.tar.xz openshift-4c20c6b76f295dc83e2ce730238b7753724e7e53.zip |
Merge pull request #3001 from detiber/python3
python3 support, add tox for better local testing against multiple python versions
Diffstat (limited to 'roles/kube_nfs_volumes')
-rw-r--r-- | roles/kube_nfs_volumes/library/partitionpool.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/roles/kube_nfs_volumes/library/partitionpool.py b/roles/kube_nfs_volumes/library/partitionpool.py index 2cd454274..1857433c7 100644 --- a/roles/kube_nfs_volumes/library/partitionpool.py +++ b/roles/kube_nfs_volumes/library/partitionpool.py @@ -3,6 +3,8 @@ Ansible module for partitioning. """ +from __future__ import print_function + # There is no pyparted on our Jenkins worker # pylint: disable=import-error import parted @@ -131,7 +133,7 @@ def partition(diskname, specs, force=False, check_mode=False): disk = None if disk and len(disk.partitions) > 0 and not force: - print "skipping", diskname + print("skipping", diskname) return 0 # create new partition table, wiping all existing data @@ -220,7 +222,7 @@ def main(): try: specs = parse_spec(sizes) - except ValueError, ex: + except ValueError as ex: err = "Error parsing sizes=" + sizes + ": " + str(ex) module.fail_json(msg=err) @@ -229,7 +231,7 @@ def main(): for disk in disks.split(","): try: changed_count += partition(disk, specs, force, module.check_mode) - except Exception, ex: + except Exception as ex: err = "Error creating partitions on " + disk + ": " + str(ex) raise # module.fail_json(msg=err) |