arg name
This commit is contained in:
parent
a14a4ed110
commit
056d5dde77
1 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@ def get_latest_version():
|
||||||
return response.content.decode('utf-8')
|
return response.content.decode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
version_to_check = sys.argv[1]
|
version_arg = sys.argv[1]
|
||||||
installed_version_info = None
|
installed_version_info = None
|
||||||
PASSED = True
|
PASSED = True
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ except Exception as ex:
|
||||||
try:
|
try:
|
||||||
installed_version = installed_version_info['clientVersion']['gitVersion']
|
installed_version = installed_version_info['clientVersion']['gitVersion']
|
||||||
# NOT Match
|
# NOT Match
|
||||||
if version_to_check[0] == '!':
|
if version_arg[0] == '!':
|
||||||
undesired_version = version_to_check[1:]
|
undesired_version = version_arg[1:]
|
||||||
print(f'undesired version: {undesired_version}')
|
print(f'undesired version: {undesired_version}')
|
||||||
if installed_version == undesired_version:
|
if installed_version == undesired_version:
|
||||||
print(
|
print(
|
||||||
|
@ -44,11 +44,11 @@ try:
|
||||||
PASSED = False
|
PASSED = False
|
||||||
# Exact Match
|
# Exact Match
|
||||||
else:
|
else:
|
||||||
if version_to_check == 'latest':
|
if version_arg == 'latest':
|
||||||
print('checking latest version')
|
print('checking latest version')
|
||||||
desired_version = get_latest_version()
|
desired_version = get_latest_version()
|
||||||
else:
|
else:
|
||||||
desired_version = version_to_check
|
desired_version = version_arg
|
||||||
|
|
||||||
print(f'desired version: {desired_version}')
|
print(f'desired version: {desired_version}')
|
||||||
if installed_version != desired_version:
|
if installed_version != desired_version:
|
||||||
|
@ -60,6 +60,6 @@ except Exception as ex:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if not PASSED:
|
if not PASSED:
|
||||||
sys.exit('Setting up of '+version_to_check+' kubectl failed')
|
sys.exit('Setting up of '+version_arg+' kubectl failed')
|
||||||
print('Test passed')
|
print('Test passed')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
Loading…
Add table
Reference in a new issue