Skip to content

Commit

Permalink
BIGTOP-4063: Adapt bigtop-select to Python 3 (#1236)
Browse files Browse the repository at this point in the history
* BIGTOP-4063: Adapt bigtop-select to Python 3
  • Loading branch information
timyuer authored Aug 2, 2024
1 parent 798c33c commit ebed06d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 241 deletions.
224 changes: 0 additions & 224 deletions bigtop-packages/src/common/bigtop-select/conf-select

This file was deleted.

19 changes: 8 additions & 11 deletions bigtop-packages/src/common/bigtop-select/distro-select
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -71,7 +71,7 @@ leaves = {
"ranger-usersync" : "ranger-usersync",
"ranger-tagsync" : "ranger-tagsync",
"livy-server" : "livy",
"livy-client" : "livy"
"livy-client" : "livy",
"alluxio": "alluxio",
"alluxio-master": "alluxio",
"alluxio-worker": "alluxio"
Expand Down Expand Up @@ -161,7 +161,7 @@ def listPackages( packages ):
if packages == None:
packages = leaves

packages.sort()
packages = sorted(packages)
for pkg in packages:
linkname = current + "/" + pkg
if os.path.isdir(linkname):
Expand All @@ -172,13 +172,11 @@ def listPackages( packages ):

# Print the avaialable package names
def printPackages():
packages = leaves.keys()
packages.sort()
packages = sorted(leaves.keys())
print("Packages:")
for pkg in packages:
print(" " + pkg)
groups = aliases.keys()
groups.sort()
groups = sorted(aliases.keys())
print("Aliases:")
for pkg in groups:
print(" " + pkg)
Expand All @@ -203,8 +201,7 @@ def printVersions():
print("ERROR: Unexpected file/directory found in %s: %s" % (root, f))
sys.exit(1)

keys = result.keys()
keys.sort()
keys = sorted(result.keys())
for k in keys:
print(result[k])

Expand All @@ -225,9 +222,9 @@ def setPackages(packages, version, rpm_mode):
sys.exit(1)

if not os.path.isdir(current):
os.mkdir(current, 0755)
os.mkdir(current, 0o755)

packages.sort()
packages = sorted(packages)
for pkg in packages:
linkname = current + "/" + pkg
if os.path.islink(linkname) and rpm_mode:
Expand Down
4 changes: 1 addition & 3 deletions bigtop-packages/src/common/bigtop-select/install_select.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ CONF_DIR=${CONF_DIR:-/etc/bigtop-select/conf.dist}

STACK_ROOT_DIR=$(echo ${PARENT_DIR} | sed -e "s/\/${BIGTOP_BASE_VERSION}$//")
STACK_SELECTOR=distro-select
CONF_SELECTOR=conf-select

# Install packages
install -d -p -m 755 $PREFIX${LIB_DIR}/
install -d -p -m 755 $PREFIX${PARENT_DIR}/
install -p -m 755 ${DISTRO_DIR}/${STACK_SELECTOR} $PREFIX${LIB_DIR}/
install -p -m 755 ${DISTRO_DIR}/${CONF_SELECTOR} $PREFIX${LIB_DIR}/
cat > $PREFIX${LIB_DIR}/params.py <<EOF
#!/usr/bin/env python2
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
Source0: install_select.sh
Source1: LICENSE
Source2: conf-select
Source3: distro-select
Source2: distro-select
Requires: bash

# "which" command is needed for a lot of projects.
Expand All @@ -53,7 +52,6 @@ This includes a collection of useful tools and files for Bigtop and Ambari
install -p -m 755 %{SOURCE0} .
install -p -m 755 %{SOURCE1} .
install -p -m 755 %{SOURCE2} .
install -p -m 755 %{SOURCE3} .


%build
Expand Down

0 comments on commit ebed06d

Please sign in to comment.