diff --git a/murano/api/__init__.py b/murano/api/__init__.py index e69de29bb..a9bd720ac 100644 --- a/murano/api/__init__.py +++ b/murano/api/__init__.py @@ -0,0 +1,14 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import murano.monkey_patch # noqa diff --git a/murano/cmd/__init__.py b/murano/cmd/__init__.py index e69de29bb..a9bd720ac 100644 --- a/murano/cmd/__init__.py +++ b/murano/cmd/__init__.py @@ -0,0 +1,14 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import murano.monkey_patch # noqa diff --git a/murano/cmd/api.py b/murano/cmd/api.py index 91c17cb06..6383c97cc 100644 --- a/murano/cmd/api.py +++ b/murano/cmd/api.py @@ -18,8 +18,6 @@ import os import sys -import eventlet - from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import log as logging @@ -36,13 +34,6 @@ from murano.common import wsgi CONF = cfg.CONF -if os.name == 'nt': - # eventlet monkey patching causes subprocess.Popen to fail on Windows - # when using pipes due to missing non blocking I/O support - eventlet.monkey_patch(os=False) -else: - eventlet.monkey_patch() - # If ../murano/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... root = os.path.join(os.path.abspath(__file__), os.pardir, os.pardir, os.pardir) diff --git a/murano/cmd/cfapi.py b/murano/cmd/cfapi.py index 9bfd922e4..29504cdbb 100644 --- a/murano/cmd/cfapi.py +++ b/murano/cmd/cfapi.py @@ -17,8 +17,6 @@ import os import sys -import eventlet - from oslo_config import cfg from oslo_log import log as logging from oslo_service import service @@ -32,13 +30,6 @@ from murano.common import wsgi CONF = cfg.CONF -if os.name == 'nt': - # eventlet monkey patching causes subprocess.Popen to fail on Windows - # when using pipes due to missing non blocking I/O support - eventlet.monkey_patch(os=False) -else: - eventlet.monkey_patch() - # If ../murano/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... root = os.path.join(os.path.abspath(__file__), os.pardir, os.pardir, os.pardir) diff --git a/murano/cmd/engine.py b/murano/cmd/engine.py index 260af903a..6a8592be3 100644 --- a/murano/cmd/engine.py +++ b/murano/cmd/engine.py @@ -17,8 +17,6 @@ import os import sys -import eventlet - from oslo_concurrency import processutils from oslo_log import log as logging from oslo_service import service @@ -29,13 +27,6 @@ from murano.common import engine CONF = config.CONF -if os.name == 'nt': - # eventlet monkey patching causes subprocess.Popen to fail on Windows - # when using pipes due to missing non blocking I/O support - eventlet.monkey_patch(os=False) -else: - eventlet.monkey_patch() - # If ../murano/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... root = os.path.join(os.path.abspath(__file__), os.pardir, os.pardir, os.pardir) diff --git a/murano/monkey_patch.py b/murano/monkey_patch.py new file mode 100644 index 000000000..28ec5f60c --- /dev/null +++ b/murano/monkey_patch.py @@ -0,0 +1,25 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +import os + +import eventlet + + +if os.name == 'nt': + # eventlet monkey patching causes subprocess.Popen to fail on Windows + # when using pipes due to missing non blocking I/O support + eventlet.monkey_patch(os=False) +else: + eventlet.monkey_patch()