Merge "Python3: Use six.moves for py2 compatibility"
This commit is contained in:
commit
ed6bd4e526
@ -24,6 +24,7 @@ import eventlet.greenpool
|
|||||||
import eventlet.greenthread
|
import eventlet.greenthread
|
||||||
import semantic_version
|
import semantic_version
|
||||||
import six
|
import six
|
||||||
|
from six.moves import reduce
|
||||||
import yaql.language.exceptions
|
import yaql.language.exceptions
|
||||||
import yaql.language.expressions
|
import yaql.language.expressions
|
||||||
from yaql.language import utils as yaqlutils
|
from yaql.language import utils as yaqlutils
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
from six.moves import range
|
||||||
|
|
||||||
from murano.dsl import constants
|
from murano.dsl import constants
|
||||||
from murano.dsl import dsl_exception
|
from murano.dsl import dsl_exception
|
||||||
|
@ -17,6 +17,7 @@ import weakref
|
|||||||
|
|
||||||
import semantic_version
|
import semantic_version
|
||||||
import six
|
import six
|
||||||
|
from six.moves import range
|
||||||
from yaql.language import utils
|
from yaql.language import utils
|
||||||
|
|
||||||
from murano.dsl import constants
|
from murano.dsl import constants
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import itertools
|
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
import six
|
import six
|
||||||
from yaql.language import specs
|
from yaql.language import specs
|
||||||
@ -75,7 +73,7 @@ def super_(context, sender, func=None):
|
|||||||
if func is None:
|
if func is None:
|
||||||
return [sender.cast(type) for type in cast_type.parents(
|
return [sender.cast(type) for type in cast_type.parents(
|
||||||
sender.real_this.type)]
|
sender.real_this.type)]
|
||||||
return itertools.imap(func, super_(context, sender))
|
return six.moves.map(func, super_(context, sender))
|
||||||
|
|
||||||
|
|
||||||
@specs.parameter('value', dsl_types.MuranoObject)
|
@specs.parameter('value', dsl_types.MuranoObject)
|
||||||
|
@ -18,6 +18,7 @@ import collections
|
|||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
import six
|
import six
|
||||||
|
from six.moves import range
|
||||||
import string
|
import string
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import cgi
|
import cgi
|
||||||
import cStringIO
|
|
||||||
import imghdr
|
import imghdr
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@ -22,6 +21,8 @@ import uuid
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
from six.moves import cStringIO
|
||||||
|
from six.moves import range
|
||||||
|
|
||||||
from murano.api.v1 import catalog
|
from murano.api.v1 import catalog
|
||||||
from murano.db.catalog import api as db_catalog_api
|
from murano.db.catalog import api as db_catalog_api
|
||||||
@ -497,7 +498,7 @@ class TestCatalogApi(test_base.ControllerTest, test_base.MuranoApiTestCase):
|
|||||||
self.expect_policy_check('upload_package')
|
self.expect_policy_check('upload_package')
|
||||||
self.expect_policy_check('publicize_package')
|
self.expect_policy_check('publicize_package')
|
||||||
|
|
||||||
file_obj_str = cStringIO.StringIO("This is some dummy data")
|
file_obj_str = cStringIO("This is some dummy data")
|
||||||
file_obj = mock.MagicMock(cgi.FieldStorage)
|
file_obj = mock.MagicMock(cgi.FieldStorage)
|
||||||
file_obj.file = file_obj_str
|
file_obj.file = file_obj_str
|
||||||
package_from_dir, _ = self._test_package()
|
package_from_dir, _ = self._test_package()
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from oslo_db import exception as db_exception
|
from oslo_db import exception as db_exception
|
||||||
|
from six.moves import range
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from murano.db.catalog import api
|
from murano.db.catalog import api
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from six.moves import range
|
||||||
|
|
||||||
from murano.dsl import helpers
|
from murano.dsl import helpers
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user