Skip to content

Commit

Permalink
fix(ns-api): rename storage section
Browse files Browse the repository at this point in the history
Make sure storage sections is always named ns_data.
The named section is used by remove-storage script.
  • Loading branch information
gsanchietti committed Dec 6, 2024
1 parent e3d87f8 commit 76d9059
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/ns-api/files/ns.storage
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ def run(cmd):
return utils.generic_error("command_failed")

def get_storage_info(u):
ret = None
for section in utils.get_all_by_type(u, 'fstab', 'mount'):
if u.get('fstab', section, 'target', default='') == '/mnt/data':
return u.get_all('fstab', section)
return None
ret = u.get_all('fstab', section)
if section != 'ns_data':
# Fix section name that get lost during the upgrade:
# the section name is used by remove-storage script
u.rename('fstab', section=section, name='ns_data')
u.commit('fstab')
break
return ret

def list_devices():
devices = []
Expand Down

0 comments on commit 76d9059

Please sign in to comment.