Merge "code compatibility with py3"
This commit is contained in:
commit
e3422a314b
@ -22,6 +22,7 @@ import textwrap
|
||||
import uuid
|
||||
|
||||
import prettytable
|
||||
import six
|
||||
import yaml
|
||||
|
||||
from monascaclient import exc
|
||||
@ -289,6 +290,6 @@ def set_env_variables(kwargs):
|
||||
'domain_name': 'OS_DOMAIN_NAME',
|
||||
'region_name': 'OS_REGION_NAME'
|
||||
}
|
||||
for k, v in environment_variables.iteritems():
|
||||
for k, v in six.iteritems(environment_variables):
|
||||
if k not in kwargs:
|
||||
kwargs[k] = env(v)
|
||||
|
@ -41,13 +41,13 @@ def fake_headers():
|
||||
'User-Agent': 'python-monascaclient'}
|
||||
|
||||
|
||||
class FakeServiceCatalog():
|
||||
class FakeServiceCatalog(object):
|
||||
|
||||
def url_for(self, endpoint_type, service_type):
|
||||
return 'http://192.168.1.5:8004/v1/f14b41234'
|
||||
|
||||
|
||||
class FakeKeystone():
|
||||
class FakeKeystone(object):
|
||||
service_catalog = FakeServiceCatalog()
|
||||
|
||||
def __init__(self, auth_token, project_id):
|
||||
@ -55,11 +55,11 @@ class FakeKeystone():
|
||||
self.project_id = project_id
|
||||
|
||||
|
||||
class FakeRaw():
|
||||
class FakeRaw(object):
|
||||
version = 110
|
||||
|
||||
|
||||
class FakeHTTPResponse():
|
||||
class FakeHTTPResponse(object):
|
||||
|
||||
version = 1.1
|
||||
|
||||
|
@ -23,6 +23,7 @@ from monascaclient.common import utils
|
||||
import monascaclient.exc as exc
|
||||
from monascaclient.openstack.common import jsonutils
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
# Alarm valid types
|
||||
severity_types = ['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']
|
||||
|
@ -18,12 +18,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
|
||||
import install_venv_common as install_venv # flake8: noqa
|
||||
|
||||
from six.moves import configparser as ConfigParser
|
||||
|
||||
|
||||
def print_help(project, venv, root):
|
||||
help = """
|
||||
@ -42,7 +43,7 @@ def print_help(project, venv, root):
|
||||
|
||||
$ %(root)s/tools/with_venv.sh <your command>
|
||||
"""
|
||||
print help % dict(project=project, venv=venv, root=root)
|
||||
print(help % dict(project=project, venv=venv, root=root))
|
||||
|
||||
|
||||
def main(argv):
|
||||
|
Loading…
Reference in New Issue
Block a user