Merge "Adds changes related to py3 compatibility"
This commit is contained in:
commit
43a7374a47
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
"""
|
"""
|
||||||
|
import six
|
||||||
from tempest_lib.cli import output_parser
|
from tempest_lib.cli import output_parser
|
||||||
|
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ class FieldValueModel(Model):
|
|||||||
class ListEntryModel(Model):
|
class ListEntryModel(Model):
|
||||||
|
|
||||||
def __init__(self, fields, values):
|
def __init__(self, fields, values):
|
||||||
for k, v in zip(fields, values):
|
for k, v in six.moves.zip(fields, values):
|
||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class ShowBlacklistCommand(show.ShowOne):
|
|||||||
client = self.app.client_manager.dns
|
client = self.app.client_manager.dns
|
||||||
data = client.blacklists.get(parsed_args.id)
|
data = client.blacklists.get(parsed_args.id)
|
||||||
_format_blacklist(data)
|
_format_blacklist(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class CreateBlacklistCommand(show.ShowOne):
|
class CreateBlacklistCommand(show.ShowOne):
|
||||||
@ -80,7 +80,7 @@ class CreateBlacklistCommand(show.ShowOne):
|
|||||||
parsed_args.pattern, parsed_args.description)
|
parsed_args.pattern, parsed_args.description)
|
||||||
|
|
||||||
_format_blacklist(data)
|
_format_blacklist(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class SetBlacklistCommand(show.ShowOne):
|
class SetBlacklistCommand(show.ShowOne):
|
||||||
@ -114,7 +114,7 @@ class SetBlacklistCommand(show.ShowOne):
|
|||||||
updated = client.blacklists.update(parsed_args.id, data)
|
updated = client.blacklists.update(parsed_args.id, data)
|
||||||
|
|
||||||
_format_blacklist(updated)
|
_format_blacklist(updated)
|
||||||
return zip(*sorted(six.iteritems(updated)))
|
return six.moves.zip(*sorted(six.iteritems(updated)))
|
||||||
|
|
||||||
|
|
||||||
class DeleteBlacklistCommand(command.Command):
|
class DeleteBlacklistCommand(command.Command):
|
||||||
|
@ -50,7 +50,7 @@ class ListRecordSetsCommand(lister.Lister):
|
|||||||
cols = self.columns
|
cols = self.columns
|
||||||
data = client.recordsets.list(parsed_args.zone_id)
|
data = client.recordsets.list(parsed_args.zone_id)
|
||||||
|
|
||||||
map(_format_recordset, data)
|
six.moves.map(_format_recordset, data)
|
||||||
return cols, (utils.get_item_properties(s, cols) for s in data)
|
return cols, (utils.get_item_properties(s, cols) for s in data)
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class ShowRecordSetCommand(show.ShowOne):
|
|||||||
data = client.recordsets.get(parsed_args.zone_id, parsed_args.id)
|
data = client.recordsets.get(parsed_args.zone_id, parsed_args.id)
|
||||||
|
|
||||||
_format_recordset(data)
|
_format_recordset(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class CreateRecordSetCommand(show.ShowOne):
|
class CreateRecordSetCommand(show.ShowOne):
|
||||||
@ -101,7 +101,7 @@ class CreateRecordSetCommand(show.ShowOne):
|
|||||||
ttl=parsed_args.ttl)
|
ttl=parsed_args.ttl)
|
||||||
|
|
||||||
_format_recordset(data)
|
_format_recordset(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class SetRecordSetCommand(show.ShowOne):
|
class SetRecordSetCommand(show.ShowOne):
|
||||||
@ -149,7 +149,7 @@ class SetRecordSetCommand(show.ShowOne):
|
|||||||
|
|
||||||
_format_recordset(updated)
|
_format_recordset(updated)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(updated)))
|
return six.moves.zip(*sorted(six.iteritems(updated)))
|
||||||
|
|
||||||
|
|
||||||
class DeleteRecordSetCommand(command.Command):
|
class DeleteRecordSetCommand(command.Command):
|
||||||
|
@ -58,7 +58,7 @@ class ShowFloatingIPCommand(show.ShowOne):
|
|||||||
client = self.app.client_manager.dns
|
client = self.app.client_manager.dns
|
||||||
data = client.floatingips.get(parsed_args.floatingip_id)
|
data = client.floatingips.get(parsed_args.floatingip_id)
|
||||||
_format_floatingip(data)
|
_format_floatingip(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class SetFloatingIPCommand(show.ShowOne):
|
class SetFloatingIPCommand(show.ShowOne):
|
||||||
@ -102,7 +102,7 @@ class SetFloatingIPCommand(show.ShowOne):
|
|||||||
parsed_args.ttl)
|
parsed_args.ttl)
|
||||||
|
|
||||||
_format_floatingip(fip)
|
_format_floatingip(fip)
|
||||||
return zip(*sorted(six.iteritems(fip)))
|
return six.moves.zip(*sorted(six.iteritems(fip)))
|
||||||
|
|
||||||
|
|
||||||
class UnsetFloatingIPCommand(command.Command):
|
class UnsetFloatingIPCommand(command.Command):
|
||||||
|
@ -59,7 +59,7 @@ class ShowTLDCommand(show.ShowOne):
|
|||||||
client = self.app.client_manager.dns
|
client = self.app.client_manager.dns
|
||||||
data = client.tlds.get(parsed_args.id)
|
data = client.tlds.get(parsed_args.id)
|
||||||
_format_tld(data)
|
_format_tld(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class CreateTLDCommand(show.ShowOne):
|
class CreateTLDCommand(show.ShowOne):
|
||||||
@ -77,7 +77,7 @@ class CreateTLDCommand(show.ShowOne):
|
|||||||
client = self.app.client_manager.dns
|
client = self.app.client_manager.dns
|
||||||
data = client.tlds.create(parsed_args.name, parsed_args.description)
|
data = client.tlds.create(parsed_args.name, parsed_args.description)
|
||||||
_format_tld(data)
|
_format_tld(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class SetTLDCommand(show.ShowOne):
|
class SetTLDCommand(show.ShowOne):
|
||||||
@ -109,7 +109,7 @@ class SetTLDCommand(show.ShowOne):
|
|||||||
|
|
||||||
data = client.tlds.update(parsed_args.id, data)
|
data = client.tlds.update(parsed_args.id, data)
|
||||||
_format_tld(data)
|
_format_tld(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class DeleteTLDCommand(command.Command):
|
class DeleteTLDCommand(command.Command):
|
||||||
|
@ -95,7 +95,7 @@ class ShowZoneCommand(show.ShowOne):
|
|||||||
data = client.zones.get(parsed_args.id)
|
data = client.zones.get(parsed_args.id)
|
||||||
|
|
||||||
_format_zone(data)
|
_format_zone(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class CreateZoneCommand(show.ShowOne):
|
class CreateZoneCommand(show.ShowOne):
|
||||||
@ -143,7 +143,7 @@ class CreateZoneCommand(show.ShowOne):
|
|||||||
parsed_args.name, parsed_args.type, **payload)
|
parsed_args.name, parsed_args.type, **payload)
|
||||||
|
|
||||||
_format_zone(data)
|
_format_zone(data)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class SetZoneCommand(show.ShowOne):
|
class SetZoneCommand(show.ShowOne):
|
||||||
@ -185,7 +185,7 @@ class SetZoneCommand(show.ShowOne):
|
|||||||
|
|
||||||
updated = client.zones.update(parsed_args.id, data)
|
updated = client.zones.update(parsed_args.id, data)
|
||||||
_format_zone(updated)
|
_format_zone(updated)
|
||||||
return zip(*sorted(six.iteritems(updated)))
|
return six.moves.zip(*sorted(six.iteritems(updated)))
|
||||||
|
|
||||||
|
|
||||||
class DeleteZoneCommand(command.Command):
|
class DeleteZoneCommand(command.Command):
|
||||||
@ -293,7 +293,7 @@ class CreateTransferRequestCommand(show.ShowOne):
|
|||||||
data = client.zone_transfers.create_request(
|
data = client.zone_transfers.create_request(
|
||||||
parsed_args.zone_id, parsed_args.target_project_id,
|
parsed_args.zone_id, parsed_args.target_project_id,
|
||||||
parsed_args.description)
|
parsed_args.description)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class ListTransferRequestsCommand(lister.Lister):
|
class ListTransferRequestsCommand(lister.Lister):
|
||||||
@ -332,7 +332,7 @@ class ShowTransferRequestCommand(show.ShowOne):
|
|||||||
|
|
||||||
data = client.zone_transfers.get_request(parsed_args.id)
|
data = client.zone_transfers.get_request(parsed_args.id)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class SetTransferRequestCommand(command.Command):
|
class SetTransferRequestCommand(command.Command):
|
||||||
@ -359,7 +359,7 @@ class SetTransferRequestCommand(command.Command):
|
|||||||
data['description'] = parsed_args.description
|
data['description'] = parsed_args.description
|
||||||
|
|
||||||
updated = client.zone_transfers.update_request(parsed_args.id, data)
|
updated = client.zone_transfers.update_request(parsed_args.id, data)
|
||||||
return zip(*sorted(six.iteritems(updated)))
|
return six.moves.zip(*sorted(six.iteritems(updated)))
|
||||||
|
|
||||||
|
|
||||||
class DeleteTransferRequestCommand(command.Command):
|
class DeleteTransferRequestCommand(command.Command):
|
||||||
@ -398,7 +398,7 @@ class AcceptTransferRequestCommand(command.Command):
|
|||||||
|
|
||||||
data = client.zone_transfers.accept_request(
|
data = client.zone_transfers.accept_request(
|
||||||
parsed_args.transfer_id, parsed_args.key)
|
parsed_args.transfer_id, parsed_args.key)
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
|
||||||
|
|
||||||
class ShowTransferAcceptCommand(show.ShowOne):
|
class ShowTransferAcceptCommand(show.ShowOne):
|
||||||
@ -416,4 +416,4 @@ class ShowTransferAcceptCommand(show.ShowOne):
|
|||||||
|
|
||||||
data = client.zone_transfers.get_accept(parsed_args.id)
|
data = client.zone_transfers.get_accept(parsed_args.id)
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return six.moves.zip(*sorted(six.iteritems(data)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user