Skip to content

Commit

Permalink
tf_pupdate.py - set minimum required python version to 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnvid Karstad committed Jun 21, 2018
1 parent 70da238 commit c56898d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tf_pupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from lxml import html
import urllib.request
import zipfile
import sys

tfver = 0.5
tfver = 0.6
debug = False
p_os = sys.platform
p_arch = platform.architecture()[0]
Expand All @@ -24,6 +25,10 @@ def remove_prefix(text, prefix):
print("Terraform provider update tool - version:",tfver,"- Arnvid L. Karstad / Basefarm")
print("Running updates for",p_os,p_arch,"/",p_tfarch)

if sys.version_info<(3,6,0):
sys.stderr.write("You need python 3.6 or later to run this script\n")
exit(1)

config = configparser.ConfigParser()
config.read('tf_pupdate.ini')
config.sections()
Expand Down Expand Up @@ -75,7 +80,7 @@ def remove_prefix(text, prefix):
if debug : print(tfp_lfilename)
tfp_lfile = Path(plugins_dir+"/"+tfp_lfilename)
if debug : print(tfp_lfile)
if os.path.isfile(tfp_lfile):
if os.path.isfile(tfp_lfile):
print("Local file exists:",tfp_lfilename,"not upgrading")
else:
print("Local file does not exist:",tfp_lfilename)
Expand Down

0 comments on commit c56898d

Please sign in to comment.