Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run(self):

setuptools.setup(
name='wavefront-cli',
version='0.1.2',
version='0.1.3',
description='VMware Aria Operations for Applications CLI Utility.',
long_description=long_description,
url='https://github.com/wavefrontHQ/wavefront-cli',
Expand Down
19 changes: 10 additions & 9 deletions sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,16 @@ function exit_with_failure() {
}

function install_pkg() {
dpkg -s $1 >> ${INSTALL_LOG} 2>&1

if [ $? -ne 0 ]; then
if ! dpkg -s $1 >> ${INSTALL_LOG} 2>&1
then
echo "Installing $1 using apt-get"
apt-get install $1 -y >> ${INSTALL_LOG} 2>&1
fi
}

function remove_pkg() {
dpkg -s $1 >> ${INSTALL_LOG} 2>&1

if [ $? -eq 0 ]; then
if ! dpkg -s $1 >> ${INSTALL_LOG} 2>&1
then
echo "Uninstalling $1 using apt-get"
apt-get remove $1 -y >> ${INSTALL_LOG} 2>&1
fi
Expand All @@ -68,6 +66,10 @@ function detect_operating_system() {
echo -e "\ntest -f /etc/debian_version" >> ${INSTALL_LOG}
echo "Debian/Ubuntu"
OPERATING_SYSTEM="DEBIAN"
elif [ -f /etc/rocky-release ]; then
echo -e "\ntest -f /etc/rocky-release" >> ${INSTALL_LOG}
echo "Rocky Linux"
OPERATING_SYSTEM="ROCKY"
elif [ -f /etc/redhat-release ] || [ -f /etc/system-release-cpe ]; then
echo -e "\ntest -f /etc/redhat-release || test -f /etc/system-release-cpe" >> ${INSTALL_LOG}
echo "RedHat/CentOS"
Expand All @@ -90,12 +92,11 @@ function detect_operating_system() {
}

function install_python() {

if [ $OPERATING_SYSTEM == "DEBIAN" ]; then
echo "Installing Python using apt-get"
apt-get update >> ${INSTALL_LOG} 2>&1
apt-get install python3 -y >> ${INSTALL_LOG} 2>&1
elif [ $OPERATING_SYSTEM == "REDHAT" ]; then
elif [ $OPERATING_SYSTEM == "REDHAT" ] || [ $OPERATING_SYSTEM == "ROCKY" ]; then
echo "Installing Python using yum"
yum install python3 -y >> ${INSTALL_LOG} 2>&1
elif [ $OPERATING_SYSTEM == "openSUSE" ] || [ $OPERATING_SYSTEM == "SLE" ]; then
Expand All @@ -122,7 +123,7 @@ function remove_python() {
echo "Uninstalling Python using apt-get"
apt-get remove python3 -y &> ${INSTALL_LOG}
apt-get autoremove -y &> ${INSTALL_LOG}
elif [ $OPERATING_SYSTEM == "REDHAT" ]; then
elif [ $OPERATING_SYSTEM == "REDHAT" ] || [ $OPERATING_SYSTEM == "ROCKY" ]; then
echo "Uninstalling Python using yum"
yum remove python3 -y &> ${INSTALL_LOG}
elif [ $OPERATING_SYSTEM == "openSUSE" ] || [ $OPERATING_SYSTEM == "SLE" ]; then
Expand Down
2 changes: 1 addition & 1 deletion wavefront_cli/lib/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_install_agent_cmd():

cmd = "curl -s {} | bash && "
if dist.strip().startswith(("Oracle Linux Server", "Fedora",
"Amazon Linux", "CentOS",
"Amazon Linux", "Rocky Linux", "CentOS",
"Red Hat Enterprise Linux")):
cmd = cmd.format(agent_pkg_rpm) + "yum -y -q install telegraf"
elif dist.strip().startswith("Ubuntu"):
Expand Down
6 changes: 3 additions & 3 deletions wavefront_cli/lib/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def get_proxy_install_cmd(proxy_next):
if proxy_next:
message.print_bold("Using proxy-next option. This will"
" install the latest beta version proxy.")

print("Detected ", dist)

cmd = "curl -s {pkg} | bash && "
if dist.strip().startswith(("Oracle Linux Server", "Fedora",
"Amazon Linux", "CentOS",
"Red Hat Enterprise Linux")):
"Red Hat Enterprise Linux",
"Rocky Linux")):
pkg = proxy_pkg_rpm
if proxy_next:
pkg = proxy_next_pkg_rpm
Expand Down Expand Up @@ -77,7 +77,7 @@ def install_proxy(proxy_next):
return install_status


# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments, too-many-positional-arguments
def configure_proxy(url, wavefront_api_token, csp_api_token=None,
csp_app_id=None, csp_app_secret=None, csp_org_id=None):
"""Configure wavefront proxy."""
Expand Down
3 changes: 2 additions & 1 deletion wavefront_cli/lib/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ def write_file(path, text):

def remove_service(service_name):
"""Delete a service."""
cmd = None
dist = check_os()
print("Detected ", dist)
if dist.startswith("Amazon Linux") or\
if dist.startswith(("Amazon Linux", "Rocky Linux")) or\
dist == "Red Hat Enterprise Linux Server":
cmd = "yum -y remove " + service_name
elif dist == "Ubuntu":
Expand Down
Loading