Make the upgrade status accessible.

This commit is contained in:
Jeffrey Townsend
2016-07-14 17:20:38 +00:00
parent a3b8906db3
commit c575a267dc

View File

@@ -157,7 +157,7 @@ class BaseUpgrade(object):
return default
UPGRADE_STATUS_JSON = "/lib/platform-config/current/upgrade.json"
UPGRADE_STATUS_JSON = "/lib/platform-config/current/onl/upgrade.json"
def update_upgrade_status(self, key, value):
data = {}
@@ -168,7 +168,6 @@ class BaseUpgrade(object):
with open(self.UPGRADE_STATUS_JSON, "w") as f:
json.dump(data, f)
#
# Initialize self.current_version, self.next_Version
# and anything required for summarize()
@@ -409,3 +408,13 @@ class BaseOnieUpgrade(BaseUpgrade):
if os.path.exists(self.ONIE_UPDATER_PATH):
self.logger.info("Removing previous onie-updater.")
os.remove(self.ONIE_UPDATER_PATH)
def upgrade_status():
data = {}
if os.path.exists(BaseUpgrade.UPGRADE_STATUS_JSON):
with open(BaseUpgrade.UPGRADE_STATUS_JSON) as f:
data = json.load(f)
return data