You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2018/05/15 11:03:54 UTC
[ambari] 01/02: AMBARI-23841. ambari-server setup throwing Error
"/usr/lib/ambari-server/lib/ambari_commons/subprocess32.py:153:
RuntimeWarning: The _posixsubprocess module is not being used" (aonishuk)
This is an automated email from the ASF dual-hosted git repository.
aonishuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
commit 43a12704fb6c524faa76d04898edb875ec27dc2c
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Tue May 15 13:08:33 2018 +0300
AMBARI-23841. ambari-server setup throwing Error "/usr/lib/ambari-server/lib/ambari_commons/subprocess32.py:153: RuntimeWarning: The _posixsubprocess module is not being used" (aonishuk)
---
.../src/main/python/ambari_commons/libs/__init__.py | 19 +++++++++++++++++++
.../python/ambari_commons/libs/ppc64le/__init__.py | 19 +++++++++++++++++++
.../ambari_commons/libs/ppc64le/_posixsubprocess.so | 0
.../python/ambari_commons/libs/x86_64/__init__.py | 19 +++++++++++++++++++
.../{ => libs/x86_64}/_posixsubprocess.so | Bin
.../src/main/python/ambari_commons/subprocess32.py | 7 +++++--
6 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/ambari-common/src/main/python/ambari_commons/libs/__init__.py b/ambari-common/src/main/python/ambari_commons/libs/__init__.py
new file mode 100644
index 0000000..e48e359
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/libs/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python2.6
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+'''
\ No newline at end of file
diff --git a/ambari-common/src/main/python/ambari_commons/libs/ppc64le/__init__.py b/ambari-common/src/main/python/ambari_commons/libs/ppc64le/__init__.py
new file mode 100644
index 0000000..e48e359
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/libs/ppc64le/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python2.6
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+'''
\ No newline at end of file
diff --git a/ambari-common/src/main/python/ambari_commons/libs/ppc64le/_posixsubprocess.so b/ambari-common/src/main/python/ambari_commons/libs/ppc64le/_posixsubprocess.so
new file mode 100644
index 0000000..e69de29
diff --git a/ambari-common/src/main/python/ambari_commons/libs/x86_64/__init__.py b/ambari-common/src/main/python/ambari_commons/libs/x86_64/__init__.py
new file mode 100644
index 0000000..e48e359
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/libs/x86_64/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python2.6
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+'''
\ No newline at end of file
diff --git a/ambari-common/src/main/python/ambari_commons/_posixsubprocess.so b/ambari-common/src/main/python/ambari_commons/libs/x86_64/_posixsubprocess.so
similarity index 100%
rename from ambari-common/src/main/python/ambari_commons/_posixsubprocess.so
rename to ambari-common/src/main/python/ambari_commons/libs/x86_64/_posixsubprocess.so
diff --git a/ambari-common/src/main/python/ambari_commons/subprocess32.py b/ambari-common/src/main/python/ambari_commons/subprocess32.py
index b9378e2..478c579 100644
--- a/ambari-common/src/main/python/ambari_commons/subprocess32.py
+++ b/ambari-common/src/main/python/ambari_commons/subprocess32.py
@@ -142,13 +142,16 @@ else:
import errno
import fcntl
import pickle
+ import platform
+ import importlib
+ posixsubprocess_package = "ambari_commons.libs.{0}".format(platform.machine())
try:
- from ambari_commons import _posixsubprocess
+ _posixsubprocess = importlib.import_module('._posixsubprocess', posixsubprocess_package)
except ImportError:
_posixsubprocess = None
import warnings
- warnings.warn("The _posixsubprocess module is not being used. "
+ warnings.warn("The _posixsubprocess module is not being used. Could not import it from " + posixsubprocess_package + " "
"Child process reliability may suffer if your "
"program uses threads.", RuntimeWarning)
try:
--
To stop receiving notification emails like this one, please contact
aonishuk@apache.org.