Replacing print with print() to provide py 2/3 compatibility
Replaced print in python 2 to print() to provide py 2/3 compatibility Change-Id: I805ecdbdd07ea89c1595c045fc5b380f9bb42335
This commit is contained in:
parent
352d4cbdd0
commit
866114dbf6
@ -1,3 +1,4 @@
|
||||
from __future__ import print_function
|
||||
import logging
|
||||
|
||||
from designateclient.v2 import client
|
||||
@ -33,7 +34,7 @@ except exceptions.RemoteError:
|
||||
|
||||
print("Recordset list...")
|
||||
for rs in client.recordsets.list(zone['id']):
|
||||
print rs
|
||||
print(rs)
|
||||
|
||||
# Here's an example of just passing "www" as the record name vs "www.i.io."
|
||||
records = ["10.0.0.1"]
|
||||
|
@ -1,3 +1,5 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import logging
|
||||
|
||||
from designateclient import exceptions
|
||||
@ -26,4 +28,4 @@ try:
|
||||
except exceptions.RemoteError:
|
||||
zone = dict([(z['name'], z) for z in client.zones.list()])['i.io.']
|
||||
|
||||
print client.recordsets.list(zone['id'])
|
||||
print(client.recordsets.list(zone['id']))
|
||||
|
@ -1,3 +1,4 @@
|
||||
from __future__ import print_function
|
||||
import logging
|
||||
|
||||
from keystoneclient.auth.identity import generic
|
||||
@ -33,4 +34,4 @@ while fetch:
|
||||
pages.append(page)
|
||||
|
||||
for page in pages:
|
||||
print page
|
||||
print(page)
|
||||
|
@ -15,7 +15,7 @@ the bindings.
|
||||
.. code-block:: python
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
from designateclient.v1 import Client
|
||||
|
||||
# Create an instance of the client, providing the necessary credentials
|
||||
@ -31,7 +31,7 @@ the bindings.
|
||||
|
||||
# Iterate the list, printing some useful information
|
||||
for domain in domains:
|
||||
print "Domain ID: %s, Name: %s" % (domain.id, domain.name)
|
||||
print("Domain ID: %s, Name: %s" % (domain.id, domain.name))
|
||||
|
||||
And the output this program might produce:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user