From dfb0e3e3c1b5b5563279bebfe222ed4762f79494 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 3 Jul 2013 18:12:58 -0500 Subject: Begin Python 3 compatability * use six.iteritems() * replace basestring with six.string_types * convert print statements to functions (they're all debugging and should be removed eventually anyway) * clean up OpenStack copyright: LLC -> Foundation Change-Id: Icb14212bcb408e63816bfec3922a697bc1a6c946 --- openstackclient/compute/v2/keypair.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'openstackclient/compute/v2/keypair.py') diff --git a/openstackclient/compute/v2/keypair.py b/openstackclient/compute/v2/keypair.py index 65f3679b..d68dae06 100644 --- a/openstackclient/compute/v2/keypair.py +++ b/openstackclient/compute/v2/keypair.py @@ -17,6 +17,7 @@ import logging import os +import six import sys from cliff import command @@ -71,7 +72,7 @@ class CreateKeypair(show.ShowOne): if public_key: info.update(keypair._info) del info['public_key'] - return zip(*sorted(info.iteritems())) + return zip(*sorted(six.iteritems(info))) else: sys.stdout.write(keypair.private_key) return ({}, {}) @@ -148,7 +149,7 @@ class ShowKeypair(show.ShowOne): info.update(keypair._info['keypair']) if not parsed_args.public_key: del info['public_key'] - return zip(*sorted(info.iteritems())) + return zip(*sorted(six.iteritems(info))) else: # NOTE(dtroyer): a way to get the public key in a similar form # as the private key in the create command -- cgit v1.2.1