Standardise variable names

This commit is contained in:
Jonathan Ervine 2020-12-16 14:23:11 +08:00
parent 5a88c253a5
commit 820e6b6ce8

View File

@ -41,8 +41,8 @@ def get_charts(ns):
def sortRevision(n):
return n['revision']
def get_chartdata(namespace, chart, records):
command = "/usr/local/bin/helm -n " + namespace + " history " + chart + " --max " + records + " -ojson" #helm3
def get_chartdata(ns, chart, records):
command = "/usr/local/bin/helm -n " + ns + " history " + chart + " --max " + records + " -ojson" #helm3
info(f"Running command: {command}")
try:
output = check_output(command.split(" "), stderr=STDOUT).decode("utf-8")
@ -54,7 +54,7 @@ def get_chartdata(namespace, chart, records):
data.sort(reverse=True, key=sortRevision)
for revision in data:
revision['chartName'] = chart
revision["namespace"] = namespace
revision["namespace"] = ns
return data
def chartRollback(revision, chart, ns):