Skip to content

Commit

Permalink
Fix to extend OS support using the distro (#20)
Browse files Browse the repository at this point in the history
* Fix to extend OS support using the distro

* incorporated review comments
  • Loading branch information
yogeshprasad authored Feb 5, 2020
1 parent dbd57d1 commit 4e59986
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion wavefront_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Initialize wavefront cli version."""
__version__ = '0.0.118'
__version__ = '0.0.119'
17 changes: 7 additions & 10 deletions wavefront_cli/lib/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,21 @@ def get_install_agent_cmd():
" [email protected].")
return cmd

if dist.strip() in ("Oracle Linux Server", "Fedora",
"Red Hat Enterprise Linux Server",
"Red Hat Enterprise Linux Workstation",
"CentOS", "CentOS Linux"
) or dist.startswith("Amazon Linux"):
if dist.strip().startswith(("Oracle Linux Server", "Fedora",
"Amazon Linux", "CentOS",
"Red Hat Enterprise Linux")):
cmd = "curl -s %s | bash" % (agent_pkg_rpm)
cmd += " && yum -y -q install telegraf"
elif dist == "Ubuntu":
elif dist.strip().startswith("Ubuntu"):
cmd = "curl -s %s | bash" % (agent_pkg_deb)
cmd += ' && apt-get -y -qq -o Dpkg::Options::="--force-confold"' \
' install telegraf'
elif dist == "debian":
elif dist.strip().lower().startswith("debian"):
cmd = "curl -s %s | bash" % (agent_pkg_deb)
cmd += ' && apt-get -o Dpkg::Options::="--force-confnew"' \
' -y install telegraf'
elif dist.strip() == "openSUSE" or\
dist.strip() == "SUSE Linux Enterprise Server" or \
dist.strip() == "SLES":
elif dist.strip().startswith(("openSUSE", "SUSE Linux Enterprise Server",
"SLES")):
cmd = "curl -s %s | bash" % (agent_pkg_rpm)
cmd += ' && zypper install telegraf'
else:
Expand Down
18 changes: 6 additions & 12 deletions wavefront_cli/lib/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,24 @@ def get_proxy_install_cmd(proxy_next):
" install the latest beta version proxy.")

print("Detected ", dist)
if dist.strip() in ("CentOS", "CentOS Linux", "Fedora",
"Oracle Linux Server",
"Red Hat Enterprise Linux Server",
"Red Hat Enterprise Linux Workstation",
) or dist.startswith("Amazon Linux"):

if dist.strip().startswith(("Oracle Linux Server", "Fedora",
"Amazon Linux", "CentOS",
"Red Hat Enterprise Linux")):
pkg = proxy_pkg_rpm
if proxy_next:
pkg = proxy_next_pkg_rpm

cmd = "curl -s %s | bash" % (pkg)
cmd += " && yum -y -q install wavefront-proxy"
elif dist in ("Ubuntu", "debian"):

elif dist.strip().lower().startswith(("ubuntu", "debian")):
pkg = proxy_pkg_deb
if proxy_next:
pkg = proxy_next_pkg_deb

cmd = "curl -s %s | bash" % pkg
cmd += " && apt-get -y -q install wavefront-proxy"
elif dist.strip() == "openSUSE" or\
dist.strip() == "SUSE Linux Enterprise Server" or \
dist.strip() == "SLES":

elif dist.strip().startswith(("openSUSE", "SUSE Linux Enterprise Server",
"SLES")):
pkg = proxy_pkg_rpm
if proxy_next:
pkg = proxy_next_pkg_rpm
Expand Down

0 comments on commit 4e59986

Please sign in to comment.