Skip to content

Commit

Permalink
Added a fix to not download alpha and beta versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnvid Karstad committed Nov 22, 2018
1 parent c367f23 commit b2167c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tf_pupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import urllib.request
import zipfile
import sys
import re

tfver = 0.6
debug = False
Expand Down Expand Up @@ -103,7 +104,11 @@ def remove_prefix(text, prefix):
if debug : print(webcontent)
html_content = html.fromstring(webcontent.content)
nodes = html_content.xpath('/html/body/ul/li/a/text()')
tfp_filename=nodes[1]
for x in range(1,10,1):
nonrelease = ["alpha","beta"]
tfp_filename=nodes[x]
if not re.compile("|".join(nonrelease),re.IGNORECASE).search(tfp_filename): break

tfp_version=remove_prefix(tfp_filename, "terraform_")
tfp_lfilename="terraform_"+tfp_version+""
tfp_url = tf_url+tfp_version+"/"+tfp_filename+"_"+p_os+"_"+p_tfarch+".zip"
Expand Down
Empty file modified tf_pupdate.sh
100644 → 100755
Empty file.

0 comments on commit b2167c8

Please sign in to comment.