mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 09:17:08 +00:00
Make the upgrade status accessible.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user