From c56898da1a42331ad87f5bff26b9803613ddd358 Mon Sep 17 00:00:00 2001 From: Arnvid Karstad Date: Thu, 21 Jun 2018 23:07:45 +0200 Subject: [PATCH] tf_pupdate.py - set minimum required python version to 3.6.0 --- tf_pupdate.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tf_pupdate.py b/tf_pupdate.py index 7407469..a18b134 100644 --- a/tf_pupdate.py +++ b/tf_pupdate.py @@ -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] @@ -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() @@ -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)