guyuqi commented on a change in pull request #796:
URL: https://github.com/apache/bigtop/pull/796#discussion_r666638488
##########
File path: bigtop-packages/src/rpm/ambari/SPECS/ambari.spec
##########
@@ -226,10 +226,11 @@ exit 0
# See the License for the specific language governing permissions and
# limitations under the License
-
-RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
+PYPATH=`find /usr/lib -maxdepth 1 -name 'python*'`
Review comment:
Yes,there may be multiple python-lib existed in `/usr/lib`.
The result of `find /usr/lib -maxdepth 1 -name 'python*'` is always sorted
as python2.x, python3.x, etc.
And `PYLIB_DIR=`echo ${PYPATH} | awk '{print $1}'`` will always select first
installed one (python2.7, ) for creating synbolic links.
Python binary (`/usr/bin/python`) is always link to the first installed
python version:
`/usr/bin/python -> python2`
And in some envrionment ( like our puppet docker
image:`bigtop/puppet:trunk-centos-8`), there is no python binary installed, but
python lib directory is available:
```
whereis python
python: /usr/lib/python3.6 /usr/lib64/python3.6 /usr/include/python3.6m
/usr/share/man/man1/python.1.gz
```
We could not get python version by the bash command `python -V`.
So I directly find the first installed python-lib directory to create
synbolic links for resource_management and jinja.
IMO, it's the balanced approach among various environments, or do you have
other good suggestions? Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]